aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-07-22 23:24:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:45 +0100
commit793ff83b165da2eb199e2c36954229b251a45b44 (patch)
tree3410558808ddef5dfbc8b40651bdce211e46ba56
parent3381c2bd9b687564224b59004fe70c790a69b8ee (diff)
downloadffmpeg-793ff83b165da2eb199e2c36954229b251a45b44.tar.gz
avcodec/rl2: set dimensions
The dimensions are always 320x200 they are hardcoded in the demuxer. Hardcode them instead in the decoder. Fixes: Timeout (16sec -> 400ms) Fixes: 15574/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RL2_fuzzer-5158614072819712 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 965e766e4892cfc45c97cca88895248a7735e7d0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/rl2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c
index 6662979c52..2d336a61e5 100644
--- a/libavcodec/rl2.c
+++ b/libavcodec/rl2.c
@@ -134,10 +134,15 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx)
Rl2Context *s = avctx->priv_data;
int back_size;
int i;
+ int ret;
s->avctx = avctx;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ ret = ff_set_dimensions(avctx, 320, 200);
+ if (ret < 0)
+ return ret;
+
/** parse extra data */
if (!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE) {
av_log(avctx, AV_LOG_ERROR, "invalid extradata size\n");