- if (s->prev_frame->data[0]) {
- ret = av_frame_copy(frame, s->prev_frame);
- if (ret < 0)
- return ret;
- } else {
- ptrdiff_t linesize[4] = { frame->linesize[0], 0, 0, 0 };
- av_image_fill_black(frame->data, linesize, avctx->pix_fmt, 0,
+ if (bytestream2_get_bytes_left(&gb) < 8LL * blocks)
+ return AVERROR_INVALIDDATA;
+
+ if (!avctx->frame_number) {
+ ptrdiff_t linesize[4] = { s->prev_frame->linesize[0], 0, 0, 0 };
+ av_image_fill_black(s->prev_frame->data, linesize, avctx->pix_fmt, 0,