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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 70570db898 libswscale: reject sizes that av_image_check_size2() refuses
70570db898 is described below

commit 70570db898ec4a8770902a37ba973be388214a3e
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Sep 24 01:00:49 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Fri Sep 25 01:18:23 2026 +0000

    libswscale: reject sizes that av_image_check_size2() refuses
    
    libavcodec and libavfilter only produce pictures that pass
    av_image_check_size2() and the width arithmetic copes with those, so
    apply the same limit to the sizes a context is created with.
    
    Fixes: out of array access
    Fixes: left shift of 1073741824 by 2 places cannot be represented in type 
'int'
    Fixes: V5KypI022pwg
    Fixes: poc_swscale.c
    Replicated through API
    Found-by: Anthony Hurtado
---
 libswscale/utils.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 55ac6c9efb..1bdc7baa54 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1244,6 +1244,12 @@ av_cold int ff_sws_init_single_context(SwsContext *sws, 
SwsFilter *srcFilter,
         return AVERROR(EINVAL);
     }
 
+    ret = av_image_check_size2(srcW, srcH, INT64_MAX, AV_PIX_FMT_NONE, 0, c);
+    if (ret >= 0)
+        ret = av_image_check_size2(dstW, dstH, INT64_MAX, AV_PIX_FMT_NONE, 0, 
c);
+    if (ret < 0)
+        return ret;
+
     if (!dstFilter)
         dstFilter = &dummyFilter;
     if (!srcFilter)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to