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

Git pushed a commit to branch master
in repository ffmpeg.

commit a74cef25392cb566fd036700f5bf03ec2f58ab4d
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Oct 2 03:35:17 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Thu Nov 19 01:10:56 2026 +0000

    swscale/swscale_unscaled: do not copy past the last line in 
packedCopyWrapper()
    
    Use ff_copyPlane()
    
    Found during triage of the security report edlOwd4qVGBw.
    
    Fixes: out of array read
    Fixes: out of array write
    Fixes: IhE83jd9Xs9n
    Replicated through API
---
 libswscale/swscale_unscaled.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index f137bcb5c4..9ef40f41c9 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -32,6 +32,7 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/mem_internal.h"
 #include "libavutil/bswap.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/avassert.h"
 #include "libavutil/avconfig.h"
@@ -2159,20 +2160,9 @@ static int packedCopyWrapper(SwsInternal *c, const 
uint8_t *const src[],
                              const int srcStride[], int srcSliceY, int 
srcSliceH,
                              uint8_t *const dst[], const int dstStride[])
 {
-    if (dstStride[0] == srcStride[0] && srcStride[0] > 0)
-        memcpy(dst[0] + dstStride[0] * srcSliceY, src[0], srcSliceH * 
dstStride[0]);
-    else {
-        int i;
-        const uint8_t *srcPtr = src[0];
-        uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;
-
-        const int length = FFMIN(FFABS(dstStride[0]), FFABS(srcStride[0]));
-        for (i = 0; i < srcSliceH; i++) {
-            memcpy(dstPtr, srcPtr, length);
-            srcPtr += srcStride[0];
-            dstPtr += dstStride[0];
-        }
-    }
+    ff_copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH,
+                 av_image_get_linesize(c->opts.src_format, c->opts.src_w, 0),
+                 dst[0], dstStride[0]);
     return srcSliceH;
 }
 

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