]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cook: Use 3 stage VLC decoding for channel_coupling
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 25 Nov 2019 20:39:48 +0000 (21:39 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 31 Dec 2019 17:43:50 +0000 (18:43 +0100)
Fixes: shift exponent -1 is negative
Fixes: out of array read
Fixes: 19028/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5759766471376896
Fixes: 19037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5734106625474560
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/cook.c

index 248e59256f0343c3f49ac85ee8212f0cc24a8e4d..d0b41a2431d8c13f3265c8cca89ab5789c8a336c 100644 (file)
@@ -759,7 +759,7 @@ static int decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
         for (i = 0; i < length; i++)
             decouple_tab[start + i] = get_vlc2(&q->gb,
                                                p->channel_coupling.table,
-                                               p->channel_coupling.bits, 2);
+                                               p->channel_coupling.bits, 3);
     else
         for (i = 0; i < length; i++) {
             int v = get_bits(&q->gb, p->js_vlc_bits);