Browse Source

avcodec/rscc: Check inflated_buf size whan it is used

Fixes: out of array access
Fixes: 27434/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5196757675540480

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit a5ed6da9bd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3.2
Michael Niedermayer 5 years ago
parent
commit
77f3b32708
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/rscc.c

+ 4
- 0
libavcodec/rscc.c View File

@@ -300,6 +300,10 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
ret = AVERROR_INVALIDDATA;
goto end;
}
if (ctx->inflated_size < pixel_size) {
ret = AVERROR_INVALIDDATA;
goto end;
}
ret = uncompress(ctx->inflated_buf, &len, gbc->buffer, packed_size);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "Pixel deflate error %d.\n", ret);


Loading…
Cancel
Save