]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/tta: Fix undefined shift
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 16 Jun 2019 13:55:55 +0000 (15:55 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 26 Jun 2019 19:26:04 +0000 (21:26 +0200)
Fixes: left shift of negative value -4483
Fixes: 15256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5738691617619968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/tta.c

index 8f097b3bcc7fcbe9d69c4accd43fefc716f340e8..c7702610b68d890603c0e47bcd226e20bbb8c42f 100644 (file)
@@ -372,7 +372,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
         // shift samples for 24-bit sample format
         int32_t *samples = (int32_t *)frame->data[0];
         for (i = 0; i < framelen * s->channels; i++)
-            *samples++ <<= 8;
+            *samples++ *= 256;
         // reset decode buffer
         s->decode_buffer = NULL;
         break;