Ensure the allocated AVCodecContext is properly freed if avcodec_parameters_to_context fails.
Signed-off-by: 0xBat <[email protected]> --- doc/examples/extract_mvs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c index 5603064d72..b5ed2c5549 100644 --- a/doc/examples/extract_mvs.c +++ b/doc/examples/extract_mvs.c @@ -109,6 +109,7 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type) ret = avcodec_parameters_to_context(dec_ctx, st->codecpar); if (ret < 0) { fprintf(stderr, "Failed to copy codec parameters to codec context\n"); + avcodec_free_context(&dec_ctx); return ret; } -- 2.52.0.windows.1 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
