This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 3cdd76ba96ab331c30d442769f49c2331a7780f8
Author:     Jun Zhao <[email protected]>
AuthorDate: Sun Apr 19 08:42:45 2026 +0800
Commit:     Jun Zhao <[email protected]>
CommitDate: Tue Apr 28 06:14:38 2026 +0000

    avcodec/libsvtav1: reject tiny inputs on SVT-AV1 < 3.0.0
    
    SVT-AV1 < 3.0.0 requires input dimensions of at least 64x64.
    Older versions may otherwise silently accept smaller inputs without
    producing output and cause the caller to hang. Reject such inputs
    explicitly in config_enc_params() to produce a clear error.
    v3.0.0+ supports sub-64px dimensions and validates the
    input itself, so the check is gated with SVT_AV1_CHECK_VERSION.
    
    Fix #22817
    
    Signed-off-by: Jun Zhao <[email protected]>
---
 libavcodec/libsvtav1.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index fec2ed596e..0e9a0eab72 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -215,6 +215,23 @@ static int config_enc_params(EbSvtAv1EncConfiguration 
*param,
     const AVPixFmtDescriptor *desc;
     av_unused const AVDictionaryEntry *en = NULL;
 
+#if !SVT_AV1_CHECK_VERSION(3, 0, 0)
+    // SVT-AV1 < 3.0.0 requires input dimensions of at least 64x64. Reject
+    // smaller inputs explicitly here to produce a clear error rather than
+    // relying on the library's internal validation, which may silently fail
+    // to produce output and cause the caller to hang.
+    // Sub-64px inputs were enabled upstream in MR !2356 (first released in
+    // v3.0.0); for those versions the library validates the dimensions
+    // itself.
+    if (avctx->width < 64 || avctx->height < 64) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Input dimensions %dx%d are smaller than the minimum 64x64 "
+               "supported by SVT-AV1 < 3.0.0.\n",
+               avctx->width, avctx->height);
+        return AVERROR(EINVAL);
+    }
+#endif
+
     // Update param from options
     if (svt_enc->enc_mode >= -1)
         param->enc_mode             = svt_enc->enc_mode;

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

Reply via email to