[FFmpeg-cvslog] lavc/libkvazaar: fix memory leak after av_dict_parse_string fail

Jun Zhao git at videolan.org
Sat Jan 4 03:07:15 EET 2020


ffmpeg | branch: master | Jun Zhao <barryjzhao at tencent.com> | Wed Jan  1 12:09:52 2020 +0800| [cf9c9a9db93ac5158ad77ba7f6d23493d7e8e222] | committer: Jun Zhao

lavc/libkvazaar: fix memory leak after av_dict_parse_string fail

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 <barryjzhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf9c9a9db93ac5158ad77ba7f6d23493d7e8e222
---

 libavcodec/libkvazaar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index a89ca7f749..02bcae3d5c 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -110,8 +110,8 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
                            entry->key, entry->value);
                 }
             }
-            av_dict_free(&dict);
         }
+        av_dict_free(&dict);
     }
 
     ctx->encoder = enc = api->encoder_open(cfg);



More information about the ffmpeg-cvslog mailing list