diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c index 40c15a0c85..5c6b505527 100644 --- a/libavcodec/proresdec.c +++ b/libavcodec/proresdec.c @@ -185,7 +185,7 @@ static av_cold int decode_init(AVCodecContext *avctx) static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, const int data_size, AVCodecContext *avctx) { - int hdr_size, width, height, flags; + int hdr_size, width, height, flags, dimensions_changed = 0; int version; const uint8_t *ptr; enum AVPixelFormat pix_fmt; @@ -214,6 +214,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, avctx->width, avctx->height, width, height); if ((ret = ff_set_dimensions(avctx, width, height)) < 0) return ret; + dimensions_changed = 1; } ctx->frame_type = (buf[12] >> 2) & 3; @@ -250,7 +251,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, } } - if (pix_fmt != ctx->pix_fmt) { + if (pix_fmt != ctx->pix_fmt || dimensions_changed) { #define HWACCEL_MAX (CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL + CONFIG_PRORES_VULKAN_HWACCEL) #if HWACCEL_MAX enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;