From: Jun Zhao <barryjz...@tencent.com>

In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Signed-off-by: Jun Zhao <barryjz...@tencent.com>
---
 libavcodec/libx265.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 963c28f..3836049 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -262,8 +262,8 @@ static av_cold int libx265_encode_init(AVCodecContext 
*avctx)
                     break;
                 }
             }
-            av_dict_free(&dict);
         }
+        av_dict_free(&dict);
     }
 
     if (ctx->params->rc.vbvBufferSize && avctx->rc_initial_buffer_occupancy > 
1000 &&
-- 
1.7.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to