avcodec/4xm: Fix vlc memleak
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 20 Jun 2019 21:58:47 +0000 (23:58 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 26 Jun 2019 19:29:35 +0000 (21:29 +0200)
Fixes: memleak
Fixes: 15297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5746203548975104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/4xm.c

index 2b88c89..89120aa 100644 (file)
@@ -697,6 +697,7 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
         len_tab[j]  = len;
     }
 
+    ff_free_vlc(&f->pre_vlc);
     if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1,
                  bits_tab, 4, 4, 0))
         return NULL;