PR #22837 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22837
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22837.patch

Clarify what is checked and that it avoids explicit generic overflow checks

Signed-off-by: Michael Niedermayer <[email protected]>


>From bbfad8bcf1ad917db068eeb80962b941e667af09 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Thu, 16 Apr 2026 13:57:21 +0200
Subject: [PATCH] avcodec/decode: Better documentation for ff_set_dimensions()

Clarify what is checked and that it avoids explicit generic overflow checks

Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/decode.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/decode.h b/libavcodec/decode.h
index 5a7ab64c29..28786f2e56 100644
--- a/libavcodec/decode.h
+++ b/libavcodec/decode.h
@@ -97,9 +97,13 @@ int ff_attach_decode_data(AVCodecContext *avctx, AVFrame 
*frame);
  */
 int ff_copy_palette(void *dst, const AVPacket *src, void *logctx);
 
-/**
- * Check that the provided frame dimensions are valid and set them on the codec
- * context.
+/*
+ * Validate and set video frame dimensions on AVCodecContext.
+ *
+ * Dimensions accepted here satisfy FFmpeg's generic image-size validation
+ * (see av_image_check_size2()). Decoder code normally should not duplicate
+ * generic width/height overflow checks before ff_get_buffer(); add local
+ * checks only for codec-specific derived sizes or complexity bounds.
  */
 int ff_set_dimensions(AVCodecContext *s, int width, int height);
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to