Commit bbed942d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/rscc: Skip empty frames (nb_tiles == 0)

Fixes: Timeout
Fixes: 6266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5692431816196096

Its not known if nb_tiles is allowed so it is not treated as an error

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent fa0c9d69
......@@ -157,6 +157,12 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
/* Read number of tiles, and allocate the array */
tiles_nb = bytestream2_get_le16(gbc);
if (tiles_nb == 0) {
av_log(avctx, AV_LOG_DEBUG, "no tiles\n");
return avpkt->size;
}
av_fast_malloc(&ctx->tiles, &ctx->tiles_size,
tiles_nb * sizeof(*ctx->tiles));
if (!ctx->tiles) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment