From 6080db7d23c012dbfaaac00e9c13d43c8dcc523f Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 5 Nov 2025 20:31:23 +0100 Subject: [PATCH] ffv1dec: call ff_get_format if width and height change --- libavcodec/ffv1.h | 1 + libavcodec/ffv1dec.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h index d6f25737f5..adf76b0644 100644 --- a/libavcodec/ffv1.h +++ b/libavcodec/ffv1.h @@ -139,6 +139,7 @@ typedef struct FFV1Context { uint32_t crcref; enum AVPixelFormat pix_fmt; enum AVPixelFormat configured_pix_fmt; + int configured_width, configured_height; const AVFrame *cur_enc_frame; int plane_count; diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 3d67798961..a70cd74af4 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -507,11 +507,15 @@ static int read_header(FFV1Context *f, RangeCoder *c) if (ret < 0) return ret; - if (f->configured_pix_fmt != f->pix_fmt) { + if (f->configured_pix_fmt != f->pix_fmt || + f->configured_width != f->avctx->width || + f->configured_height != f->avctx->height) { f->avctx->pix_fmt = get_pixel_format(f); if (f->avctx->pix_fmt < 0) return AVERROR(EINVAL); f->configured_pix_fmt = f->pix_fmt; + f->configured_width = f->avctx->width; + f->configured_height = f->avctx->height; } ff_dlog(f->avctx, "%d %d %d\n",