Browse Source

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 8c7d5fcfc3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1.5
Michael Niedermayer 6 years ago
parent
commit
07b6caa309
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/dxv.c

+ 1
- 1
libavcodec/dxv.c View File

@@ -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;


Loading…
Cancel
Save