[FFmpeg-cvslog] avcodec/magicyuv: Free previous VLC table

Michael Niedermayer git at videolan.org
Tue Nov 3 01:47:17 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Nov  2 01:21:25 2020 +0100| [bbba41704b854492f6b4c06e9cedeb611d6ff537] | committer: Michael Niedermayer

avcodec/magicyuv: Free previous VLC table

Fixes: memleak
Fixes: 26788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-5184116808744960

Regression since: 1bf30a1beb7527887c9b466d07765d20fa3b5412

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/magicyuv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index f13351e5b5..c7e2754c44 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -89,6 +89,7 @@ static int huff_build(HuffEntry he[], uint16_t codes_count[33],
         he[i].code = codes_count[he[i].len];
         codes_count[he[i].len]++;
     }
+    ff_free_vlc(vlc);
     return init_vlc(vlc, FFMIN(max, 12), nb_elems,
                     &he[0].len,  sizeof(he[0]), sizeof(he[0].len),
                     &he[0].code, sizeof(he[0]), sizeof(he[0].code), 0);



More information about the ffmpeg-cvslog mailing list