X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcdgraphics.c;h=469128964c20e69f9890a54ae4eb2ec370d59a67;hb=648f5c93820ed204bdc477562b61055068c412fe;hp=be85e542887872af1c99145a729bec7b2bc00f7b;hpb=bad70b7af6b909691f5389e14eb7d0c03db10af9;p=ffmpeg diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index be85e542887..469128964c2 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -81,11 +81,8 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); cc->transparency = -1; - avctx->width = CDG_FULL_WIDTH; - avctx->height = CDG_FULL_HEIGHT; avctx->pix_fmt = AV_PIX_FMT_PAL8; - - return 0; + return ff_set_dimensions(avctx, CDG_FULL_WIDTH, CDG_FULL_HEIGHT); } static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data) @@ -286,7 +283,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, bytestream2_init(&gb, avpkt->data, avpkt->size); - if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, cc->frame, 0)) < 0) return ret; if (!cc->cleared) { memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);