Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-04 16:41:18 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-06 04:44:35 +0300
commit00312b5ea4a240af39a30acf8d6570c147734717 (patch)
treef68a74b7299929778ce37a1f8b25b6261f0723ef
parentb7904b58afdd12bf0dac41ee6c77f895c3af05bc (diff)
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>
-rw-r--r--libavcodec/dxv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 4b1c2d25cc..6f3c075d06 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -335,6 +335,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;
}