diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-17 00:07:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-21 14:52:35 +0200 |
commit | d7b53e87b9e572e349a36e7c0eb6a08a981ab8a7 (patch) | |
tree | ceaba92fba33b2dfbf9a56275426ab2ddc140472 | |
parent | 4cad001b049477078f33bf752f3fbc2448fc139f (diff) | |
download | ffmpeg-d7b53e87b9e572e349a36e7c0eb6a08a981ab8a7.tar.gz |
avcodec/takdec: Fix runtime error: signed integer overflow: 8192 * 524308 cannot be represented in type 'int'
Fixes: 1630/clusterfuzz-testcase-minimized-6326111917047808
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 955db411929a9876d3cd016fbbb9c49b6362feba)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/takdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 14e51b166c..b0cbba0e0e 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -256,11 +256,11 @@ static int decode_segment(TAKDecContext *s, int8_t mode, int32_t *decoded, int l code = xcodes[mode - 1]; for (i = 0; i < len; i++) { - int x = get_bits_long(gb, code.init); + unsigned x = get_bits_long(gb, code.init); if (x >= code.escape && get_bits1(gb)) { x |= 1 << code.init; if (x >= code.aescape) { - int scale = get_unary(gb, 1, 9); + unsigned scale = get_unary(gb, 1, 9); if (scale == 9) { int scale_bits = get_bits(gb, 3); if (scale_bits > 0) { |