[FFmpeg-cvslog] avcodec/dxv: Check op_offset in dxv_decompress_yo()

Michael Niedermayer git at videolan.org
Mon Sep 30 23:45:56 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Sep 30 08:02:11 2019 +0200| [97450d2b6a08769cbc4665bc66f6db9e8c5da2a4] | committer: Michael Niedermayer

avcodec/dxv: Check op_offset in dxv_decompress_yo()

Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int'
Fixes: 17745/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5734628463214592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=97450d2b6a08769cbc4665bc66f6db9e8c5da2a4
---

 libavcodec/dxv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 8d5e4b1c6c..d67412a3a2 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -799,6 +799,9 @@ static int dxv_decompress_yo(DXVContext *ctx, GetByteContext *gb,
     uint8_t *dst, *table0[256] = { 0 }, *table1[256] = { 0 };
     int ret, state = 0, skip, oi = 0, v, vv;
 
+    if (op_offset < 8 || op_offset - 8 > bytestream2_get_bytes_left(gb))
+        return AVERROR_INVALIDDATA;
+
     dst = tex_data;
     bytestream2_skip(gb, op_offset - 8);
     if (op_size > max_op_size)



More information about the ffmpeg-cvslog mailing list