OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43cd33b
)
avcodec/pixlet: avoid some overflows
author
Paul B Mahol
<onemda@gmail.com>
Sat, 24 Dec 2016 09:26:27 +0000
(10:26 +0100)
committer
Paul B Mahol
<onemda@gmail.com>
Sat, 24 Dec 2016 09:26:27 +0000
(10:26 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/pixlet.c
patch
|
blob
|
history
diff --git
a/libavcodec/pixlet.c
b/libavcodec/pixlet.c
index
1755fb8
..
e78b666
100644
(file)
--- 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;