mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-01 18:21:04 +00:00
avcodec/utils: Improve check for freeing codec private options
Don't check for AVCodec.priv_data_size (which is always true if AVCodec.priv_class is set). Instead check for AVCodecContext.priv_data to actually exist. (Note: av_opt_free(NULL) is a no-op.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
502c5fe101
commit
c6e54d14c5
@ -1030,7 +1030,7 @@ free_and_end:
|
|||||||
if (HAVE_THREADS && avci->thread_ctx)
|
if (HAVE_THREADS && avci->thread_ctx)
|
||||||
ff_thread_free(avctx);
|
ff_thread_free(avctx);
|
||||||
|
|
||||||
if (codec->priv_class && codec->priv_data_size)
|
if (codec->priv_class && avctx->priv_data)
|
||||||
av_opt_free(avctx->priv_data);
|
av_opt_free(avctx->priv_data);
|
||||||
av_opt_free(avctx);
|
av_opt_free(avctx);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user