frame_number will not increase if nothing is output
Fixes: Timeout
Fixes: 9057/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-4844661498707968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
int hscroll;
int vscroll;
int transparency;
+ int cleared;
} CDGraphicsContext;
static av_cold int cdg_decode_init(AVCodecContext *avctx)
if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
return ret;
- if (!avctx->frame_number) {
+ if (!cc->cleared) {
memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);
memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
+ cc->cleared = 1;
}
command = bytestream2_get_byte(&gb);