diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-27 00:29:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:43 +0100 |
commit | 07b6caa309be5a74b18fbf3723a3c54a246fbd07 (patch) | |
tree | 2ea5ae4f1f5a2d30f98f8d37ac26f55704495b73 | |
parent | 3f2f2b18c832c206456e2ef08131fa9cc7e682a5 (diff) | |
download | ffmpeg-07b6caa309be5a74b18fbf3723a3c54a246fbd07.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index e28a6ba724..03e8270463 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -743,7 +743,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; |