aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/magicyuv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-02 01:21:25 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-11-03 00:46:59 +0100
commitbbba41704b854492f6b4c06e9cedeb611d6ff537 (patch)
treec37f45f2635a0c948b7ed0f6bf5c41945195debc /libavcodec/magicyuv.c
parent2610acb49a140901dacbd36c598a5514cf9ade0d (diff)
downloadffmpeg-bbba41704b854492f6b4c06e9cedeb611d6ff537.tar.gz
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@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/magicyuv.c')
-rw-r--r--libavcodec/magicyuv.c1
1 files changed, 1 insertions, 0 deletions
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);