mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
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>
This commit is contained in:
parent
a05d292756
commit
f4319997ad
@ -134,10 +134,15 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx)
|
|||||||
Rl2Context *s = avctx->priv_data;
|
Rl2Context *s = avctx->priv_data;
|
||||||
int back_size;
|
int back_size;
|
||||||
int i;
|
int i;
|
||||||
|
int ret;
|
||||||
|
|
||||||
s->avctx = avctx;
|
s->avctx = avctx;
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
|
|
||||||
|
ret = ff_set_dimensions(avctx, 320, 200);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/** parse extra data */
|
/** parse extra data */
|
||||||
if (!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE) {
|
if (!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "invalid extradata size\n");
|
av_log(avctx, AV_LOG_ERROR, "invalid extradata size\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user