aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-11-09 19:59:27 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-11-16 13:18:23 +0100
commit26610256798174b0216ae807d92af3e712b99040 (patch)
tree248b4d198b8442f209da8e999860fc532583dbf9 /libavcodec
parent14c8795361a8b59c575cdce60961d9086aedd2b4 (diff)
downloadffmpeg-26610256798174b0216ae807d92af3e712b99040.tar.gz
avcodec/shorten: Fix integer overflow with offset
Fixes: signed integer overflow: -1625810908 - 582229060 cannot be represented in type 'int' Fixes: 10977/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5732602018267136 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 2f888771cd1ce8d68d4b18a1009650c1f260aaf2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/shorten.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index fa5ed3b64b..181d89f021 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -382,7 +382,7 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
/* subtract offset from previous samples to use in prediction */
if (command == FN_QLPC && coffset)
for (i = -pred_order; i < 0; i++)
- s->decoded[channel][i] -= coffset;
+ s->decoded[channel][i] -= (unsigned)coffset;
/* decode residual and do LPC prediction */
init_sum = pred_order ? (command == FN_QLPC ? s->lpcqoffset : 0) : coffset;
@@ -397,7 +397,7 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
/* add offset to current samples */
if (command == FN_QLPC && coffset)
for (i = 0; i < s->blocksize; i++)
- s->decoded[channel][i] += coffset;
+ s->decoded[channel][i] += (unsigned)coffset;
return 0;
}