aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-27 00:29:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:55 +0100
commit0147b7420584c02be7b31b2a0d0a35a6a7d3e307 (patch)
treef482af2b9b997b068a938a322a1937705d2435a9
parentdaa398e80e57986185058d180041631f45137660 (diff)
downloadffmpeg-0147b7420584c02be7b31b2a0d0a35a6a7d3e307.tar.gz
avcodec/dxv: Check op_offset in both directions
Fixes: signed integer overflow: 61 + 2147483647 cannot be represented in type 'int' Fixes: 15311/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5742552826773504 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 8c7d5fcfc32d65951039ab2bb78947a41bdd96c4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/dxv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index ae79de981f..8d5e4b1c6c 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -745,7 +745,7 @@ static int dxv_decompress_cocg(DXVContext *ctx, GetByteContext *gb,
int skip0, skip1, oi0 = 0, oi1 = 0;
int ret, state0 = 0, state1 = 0;
- if (op_offset < 12)
+ if (op_offset < 12 || op_offset - 12 > bytestream2_get_bytes_left(gb))
return AVERROR_INVALIDDATA;
dst = tex_data;