]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/libx264: call x264_param_cleanup() if available
authorJames Almer <jamrial@gmail.com>
Fri, 10 Jul 2020 20:47:57 +0000 (17:47 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 17 Jul 2020 18:24:56 +0000 (15:24 -0300)
The documentation states it should be used to free any memory allocated
by x264_param_parse().

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/libx264.c

index 479dfe323cc8f54ad03880e0308a611e52bee2e3..7bbeab7d4cd9c8d40ff1f317a56784870b1ea664 100644 (file)
@@ -511,6 +511,10 @@ static av_cold int X264_close(AVCodecContext *avctx)
     av_freep(&x4->sei);
     av_freep(&x4->reordered_opaque);
 
+#if X264_BUILD >= 161
+    x264_param_cleanup(&x4->params);
+#endif
+
     if (x4->enc) {
         x264_encoder_close(x4->enc);
         x4->enc = NULL;