aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-24 23:41:24 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:58 +0100
commit3fe22f2a0d76301de4567cdbade66c1992a57509 (patch)
tree0951ddeea58840f8859e7a073a12473c2a254116
parent9f895e984b9238727bd442c7c3bba97b0268d2ca (diff)
downloadffmpeg-3fe22f2a0d76301de4567cdbade66c1992a57509.tar.gz
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> (cherry picked from commit c6e54d14c55221b7380a0e86d7a42b60ff9e5eeb)
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3e841f09c5..e19670b7c8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1032,7 +1032,7 @@ free_and_end:
if (HAVE_THREADS && avci->thread_ctx)
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);