summaryrefslogtreecommitdiff
path: root/libavcodec/pixlet.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-12-24 10:26:27 +0100
committerPaul B Mahol <onemda@gmail.com>2016-12-24 10:26:27 +0100
commitab31b46b89362041a8e37cb0aac67cf3b53c2524 (patch)
treec669fa1aa7d31243da5d3242688bb1d92f8fe7d6 /libavcodec/pixlet.c
parent43cd33be16b21b9a217025e208f4ffbf0bf81da4 (diff)
downloadffmpeg-ab31b46b89362041a8e37cb0aac67cf3b53c2524.tar.gz
avcodec/pixlet: avoid some overflows
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/pixlet.c')
-rw-r--r--libavcodec/pixlet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index 1755fb81fb..e78b666359 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -246,7 +246,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i
value = 0;
} else {
xflag &= 1u;
- tmp = c * ((yflag + 1) >> 1) + (c >> 1);
+ tmp = (int64_t)c * ((yflag + 1) >> 1) + (c >> 1);
value = xflag + (tmp ^ -xflag);
}
@@ -256,7 +256,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i
j = 0;
dst += stride;
}
- state += d * yflag - (d * state >> 8);
+ state += (int64_t)d * yflag - (d * state >> 8);
flag = 0;