aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dxv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-04 15:41:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 01:05:29 +0200
commit439757d38a6a88d1202766cd712d6f2da263461d (patch)
treecc2ce85d706fb53bba9b7d16a967e10879b88536 /libavcodec/dxv.c
parent90c38d6ab8df4198ee2ecb32e0f05af9ffb0a65a (diff)
downloadffmpeg-439757d38a6a88d1202766cd712d6f2da263461d.tar.gz
avcodec/dxv: Check remaining bytes in dxv_decompress_raw()
Fixes: Timeout Fixes: 2006/clusterfuzz-testcase-minimized-5766515037044736 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 eb5049227033d946add93c0714bb8a28d94166f1) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dxv.c')
-rw-r--r--libavcodec/dxv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 05a9aadd24..f194b134b5 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -331,6 +331,9 @@ static int dxv_decompress_raw(AVCodecContext *avctx)
DXVContext *ctx = avctx->priv_data;
GetByteContext *gbc = &ctx->gbc;
+ if (bytestream2_get_bytes_left(gbc) < ctx->tex_size)
+ return AVERROR_INVALIDDATA;
+
bytestream2_get_buffer(gbc, ctx->tex_data, ctx->tex_size);
return 0;
}