diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-03 00:47:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-09 15:33:53 +0100 |
commit | 6e0b5d3a20e107860a34e90139b860d6b8219a1d (patch) | |
tree | 40ee3e9032d4d3289c2ed3a14c3f1e56bc09783d | |
parent | f94b4f161151cc95b6d0ffc7671bbc0a1252130b (diff) | |
download | ffmpeg-6e0b5d3a20e107860a34e90139b860d6b8219a1d.tar.gz |
avcodec/dxv: Correct integer overflow in get_opcodes()
Fixes: 13099/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5665598896340992
Fixes: signed integer overflow: 2147483647 + 7 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/dxv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index bf53d7d706..aef5ec19dd 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -426,7 +426,8 @@ static int fill_optable(unsigned *table0, OpcodeTable *table1, int nb_elements) static int get_opcodes(GetByteContext *gb, uint32_t *table, uint8_t *dst, int op_size, int nb_elements) { OpcodeTable optable[1024]; - int sum, x, val, lshift, rshift, ret, size_in_bits, i, idx; + int sum, x, val, lshift, rshift, ret, i, idx; + int64_t size_in_bits; unsigned endoffset, newoffset, offset; unsigned next; uint8_t *src = (uint8_t *)gb->buffer; |