PR #22985 opened by michaelni URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22985 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22985.patch
Fixes: out of array access Fixes: DFVULN-694 *Reporter: Zhenpeng (Leo) Lin at depthfirst* Signed-off-by: Michael Niedermayer <[email protected]> >From 9aac6f327efaa285358a5233d62d96129d4551dd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Fri, 1 May 2026 16:35:51 +0200 Subject: [PATCH] swscale/swscale_unscaled: adjust last line copy Fixes: out of array access Fixes: DFVULN-694 *Reporter: Zhenpeng (Leo) Lin at depthfirst* Signed-off-by: Michael Niedermayer <[email protected]> --- libswscale/swscale_unscaled.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 1b09dbd5aa..fa14e1ec12 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -127,9 +127,12 @@ void ff_copyPlane(const uint8_t *src, int srcStride, int srcSliceY, int srcSliceH, int width, uint8_t *dst, int dstStride) { + if (!srcSliceH) + return; + dst += dstStride * srcSliceY; if (dstStride == srcStride && srcStride > 0) { - memcpy(dst, src, srcSliceH * dstStride); + memcpy(dst, src, (srcSliceH - 1) * dstStride + width); } else { int i; for (i = 0; i < srcSliceH; i++) { -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
