aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-16 15:55:55 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-02 19:41:48 +0100
commit7b9ca45a43175a1e1d2cada8dfe27f32cb1f7968 (patch)
tree1154dae90fdf04e3c9e020cdea2fec9c4d8b9c7f
parent58c95520ee4e5f41d8d38045c022dfafd3bc9134 (diff)
downloadffmpeg-7b9ca45a43175a1e1d2cada8dfe27f32cb1f7968.tar.gz
avcodec/tta: Fix undefined shift
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> (cherry picked from commit ebccd2f778a861b41ad38a8464ea120d4f16b2d7) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/tta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 1e2e9c4ef4..2bbf4adcec 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -370,7 +370,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;