[FFmpeg-cvslog] avcodec/dxv: Check remaining space in CHECKPOINT()

Michael Niedermayer git at videolan.org
Thu Mar 28 23:21:35 EET 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Mar 20 22:29:21 2019 +0100| [4daec0c6777a6fd545d9e8dcaf9cb6a2cd083235] | committer: Michael Niedermayer

avcodec/dxv: Check remaining space in CHECKPOINT()

Fixes: Timeout (77sec -> 1sec)
Fixes: 13407/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5093143018471424

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

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

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

diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index aef5ec19dd..6fe5516505 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -256,6 +256,8 @@ static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
 #define CHECKPOINT(x)                                                         \
     do {                                                                      \
         if (state == 0) {                                                     \
+            if (bytestream2_get_bytes_left(gbc) < 4)                          \
+                return AVERROR_INVALIDDATA;                                   \
             value = bytestream2_get_le32(gbc);                                \
             state = 16;                                                       \
         }                                                                     \



More information about the ffmpeg-cvslog mailing list