[FFmpeg-cvslog] swscale/swscale_unscaled: don't add offsets to more NULL pointers

James Almer git at videolan.org
Sat Jul 19 03:36:14 EEST 2025


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Jul 18 21:35:26 2025 -0300| [11032d819db2c9b851933afe4cddb7ba61719f99] | committer: James Almer

swscale/swscale_unscaled: don't add offsets to more NULL pointers

Continuation of af9b43455a972841154b194057a79ee8b606e727.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11032d819db2c9b851933afe4cddb7ba61719f99
---

 libswscale/swscale_unscaled.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index c235269d54..3d9a5c11a8 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -806,7 +806,7 @@ static void packed16togbra16(const uint8_t *src, int srcStride,
                 }
             }
         }
-        for (i = 0; i < 4; i++)
+        for (i = 0; i < 4 && dst[i]; i++)
             dst[i] += dstStride[i] >> 1;
     }
 }
@@ -878,7 +878,7 @@ static void packed30togbra10(const uint8_t *src, int srcStride,
             }
             break;
         }
-        for (i = 0; i < 4; i++)
+        for (i = 0; i < 4 && dst[i]; i++)
             dst[i] += dstStride[i] >> 1;
     }
 }



More information about the ffmpeg-cvslog mailing list