On Mon, 17 Dec 2018, BIGLER Don (Framatome) wrote:

Attached is a patch that fixes a potential segmentation fault in avdevice/decklink when used in a multi-threaded environment outside of ffmpeg. Because the capture_started flag is not set the stream is not closed properly. This can cause a segmentation fault when the input callback is called in a multi-threaded reader that has not stopped reading before the connection is closed.

It might be better just to call the cleanup functions unconditonally in ff_decklink_read_close if ctx->dli is not null, e.g.:

    if (ctx->dli) {
        ctx->dli->StopStreams();
        ctx->dli->DisableVideoInput();
        ctx->dli->DisableAudioInput();
    }

Input format autodetection can start the stream long before you added the capture_started line.

Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to