Fixes: memleak
Fixes: 
60058/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5665259244093440

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavformat/id3v2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 38c86a8e79..69193933e0 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -309,8 +309,10 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, 
int encoding,
         avio_w8(dynbuf, 0);
 
     dynsize = avio_close_dyn_buf(dynbuf, dst);
-    if (dynsize <= 0)
+    if (dynsize <= 0) {
+        av_freep(dst);
         return AVERROR(ENOMEM);
+    }
     *maxread = left;
 
     return 0;
-- 
2.17.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