Browse Source

avcodec/dxv: Check that there is enough data to decompress

Fixes: Timeout
Fixes: 10979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-6178582203203584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2
Michael Niedermayer 6 years ago
parent
commit
2bc3811c0d
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/dxv.c

+ 6
- 0
libavcodec/dxv.c View File

@@ -1192,6 +1192,12 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
ret = decompress_tex(avctx);
if (ret < 0)
return ret;
{
int w_block = avctx->coded_width / ctx->texture_block_w;
int h_block = avctx->coded_height / ctx->texture_block_h;
if (w_block * h_block * ctx->tex_step > ctx->tex_size * 8LL)
return AVERROR_INVALIDDATA;
}

tframe.f = data;
ret = ff_thread_get_buffer(avctx, &tframe, 0);


Loading…
Cancel
Save