aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-19 18:02:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-19 18:13:29 +0200
commit7ecfe4dc363435c81e66dd14881dc0b0ccc73fb1 (patch)
treee3db88c9379742d7b4490142d770cc59ed95e0b0
parent7494b49780b2f97f85459044306fdfdf00c8ae5d (diff)
downloadffmpeg-7ecfe4dc363435c81e66dd14881dc0b0ccc73fb1.tar.gz
avcodec/diracdec: Fix potential integer overflow
Fixes CID1361948 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/diracdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 05c79005eb..1d7bb9b98b 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -903,8 +903,8 @@ static int decode_lowdelay(DiracContext *s)
} else {
for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
- bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
- - slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
+ bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den
+ - slice_num * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den;
slices[slice_num].bytes = bytes;
slices[slice_num].slice_x = slice_x;
slices[slice_num].slice_y = slice_y;