diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-26 02:15:34 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-27 12:23:23 +0100 |
commit | bbed942dfd64c43d8f943532d8e12f10e7613938 (patch) | |
tree | f071999d4ba050073058d351dbfd9939ca5e91ae | |
parent | fa0c9d69d3d70ab81400c54a7a7d1446c678ef7a (diff) | |
download | ffmpeg-bbed942dfd64c43d8f943532d8e12f10e7613938.tar.gz |
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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/rscc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index f270cd5351..dae5e84634 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -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) { |