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

Git pushed a commit to branch master
in repository ffmpeg.

commit ff53919a2d8442058d58ba0e83d16cc9e29d73fb
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Oct 7 04:50:42 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Tue Oct 13 02:29:51 2026 +0000

    avformat/img2enc: Compute the split plane sizes in 64 bit
    
    64 bit plane sizes and rejecting non-positive dimensions were suggested in 
the report.
    
    Fixes: out of array read
    Fixes: signed integer overflow
    Fixes: PbVEU2cWUlo7
    Fixes: AISLE-2026-0111-00134
    Out of array read Replicated through UnModified FFmpeg with ASAN
    Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
    Found-by: Joshua Rogers <[email protected]>
---
 libavformat/img2enc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 1296da8ec7..5a39a1b0c0 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -279,13 +279,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     av_bprint_finalize(&filename, NULL);
 
     if (img->split_planes) {
-        int ysize = par->width * par->height;
-        int usize = AV_CEIL_RSHIFT(par->width, desc->log2_chroma_w) * 
AV_CEIL_RSHIFT(par->height, desc->log2_chroma_h);
+        int64_t ysize = (int64_t)par->width * par->height;
+        int64_t usize = (int64_t)AV_CEIL_RSHIFT(par->width, 
desc->log2_chroma_w) * AV_CEIL_RSHIFT(par->height, desc->log2_chroma_h);
         if (desc->comp[0].depth >= 9) {
             ysize *= 2;
             usize *= 2;
         }
-        if (ysize + 2*usize + (desc->nb_components > 3) * ysize > pkt->size) {
+        if (par->width <= 0 || par->height <= 0 ||
+            ysize > pkt->size ||
+            ysize + 2*usize + (desc->nb_components > 3) * ysize > pkt->size) {
             ret = AVERROR(EINVAL);
             goto fail;
         }

-- 
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