[FFmpeg-cvslog] swscale/swscale_internal: Avoid unsigned for slice parameters

Michael Niedermayer git at videolan.org
Thu Sep 30 23:23:42 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 30 17:52:53 2021 +0200| [9f40b5badbead0f454f195e88b4dc7950b40f665] | committer: Michael Niedermayer

swscale/swscale_internal: Avoid unsigned for slice parameters

Mixing unsigned and signed often leads to unexpected arithmetic results.
Fixes: out of array write
Found-by: Paul B Mahol <onemda at gmail.com>
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index e6e7b934b6..708facba67 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -311,8 +311,8 @@ typedef struct SwsContext {
     int              nb_slice_ctx;
 
     // values passed to current sws_receive_slice() call
-    unsigned int dst_slice_start;
-    unsigned int dst_slice_height;
+    int dst_slice_start;
+    int dst_slice_height;
 
     /**
      * Note that src, dst, srcStride, dstStride will be copied in the



More information about the ffmpeg-cvslog mailing list