]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/apedec: Fix invalid shift with 24 bps
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 11 Feb 2020 22:56:45 +0000 (23:56 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 12 Feb 2020 16:05:30 +0000 (17:05 +0100)
Fixes: left shift of negative value -463
Fixes: 20542/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5688714435231744
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/apedec.c

index 0e749db63b54b55bd9a16104a8d5d25700afc374..d643d6790e8b302f5c6f565cfcf2cc2b873db148 100644 (file)
@@ -1555,7 +1555,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
         for (ch = 0; ch < s->channels; ch++) {
             sample24 = (int32_t *)frame->data[ch];
             for (i = 0; i < blockstodecode; i++)
-                *sample24++ = s->decoded[ch][i] << 8;
+                *sample24++ = s->decoded[ch][i] * 256;
         }
         break;
     }