From ac64c52b96e2545c5f51d79eb2da9f12bb5168e0 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 11 Jul 2025 16:46:27 +0200 Subject: [PATCH] avcodec/encode: Remove redundant av_image_check_size2() The dimensions have already been checked during init. Signed-off-by: Andreas Rheinhardt --- libavcodec/encode.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index c1a9bd587c..1eca5e38c1 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -18,12 +18,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/emms.h" #include "libavutil/frame.h" -#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem.h" #include "libavutil/pixdesc.h" @@ -357,8 +355,6 @@ static int encode_receive_packet_internal(AVCodecContext *avctx, AVPacket *avpkt if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) { if ((avctx->flags & AV_CODEC_FLAG_PASS1) && avctx->stats_out) avctx->stats_out[0] = '\0'; - if (av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) - return AVERROR(EINVAL); } if (ffcodec(avctx->codec)->cb_type == FF_CODEC_CB_TYPE_RECEIVE_PACKET) {