Fixes: Timeout (17 sec -> 65 milli sec)
Fixes: 13264/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-5711167941509120
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 9a9f0e239c1c6f5c96cc90ba673087f86ca1eabc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -80,11 +80,8 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) |
80 | 80 |
return AVERROR(ENOMEM); |
81 | 81 |
cc->transparency = -1; |
82 | 82 |
|
83 |
- avctx->width = CDG_FULL_WIDTH; |
|
84 |
- avctx->height = CDG_FULL_HEIGHT; |
|
85 | 83 |
avctx->pix_fmt = AV_PIX_FMT_PAL8; |
86 |
- |
|
87 |
- return 0; |
|
84 |
+ return ff_set_dimensions(avctx, CDG_FULL_WIDTH, CDG_FULL_HEIGHT); |
|
88 | 85 |
} |
89 | 86 |
|
90 | 87 |
static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data) |