diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-20 22:29:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-28 21:32:31 +0100 |
commit | 4daec0c6777a6fd545d9e8dcaf9cb6a2cd083235 (patch) | |
tree | 4867f47a142ec54a99cf7de04196c75893870fca | |
parent | 0ac3befd479877f11c795ecef8bf1ce2184c5a7a (diff) | |
download | ffmpeg-4daec0c6777a6fd545d9e8dcaf9cb6a2cd083235.tar.gz |
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@niedermayer.cc>
-rw-r--r-- | libavcodec/dxv.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; \ } \ |