From 5e1456f2e11672f25f83d5bab7a989866ee40c48 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 25 Mar 2025 06:15:46 +0100 Subject: [PATCH 12/44] avcodec/vc1dec: Use ff_mpv_decode_reinit() Given that it is stricter wrt invalid dimensions we can avoid checking the dimensions manually here. (Notice that due to the ff_mpv_decode_init() call before ff_mpv_common_init() the MpegEncContext and AVCodecContext dimensions already coincide.) Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1dec.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 7ee014d4b6..b9da1b25dc 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -47,7 +47,6 @@ #include "vc1_vlc_data.h" #include "libavutil/attributes.h" #include "libavutil/avassert.h" -#include "libavutil/imgutils.h" #include "libavutil/mem.h" #include "libavutil/thread.h" @@ -456,17 +455,13 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx) MpegEncContext *const s = &v->s; int ret; - ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); - if (ret < 0) - return ret; - ret = ff_mpv_decode_init(s, avctx); if (ret < 0) return ret; avctx->pix_fmt = vc1_get_format(avctx); - ret = ff_mpv_common_init(s); + ret = ff_mpv_decode_reinit(s); if (ret < 0) return ret; -- 2.45.2