[FFmpeg-cvslog] swscale: fix integer overflows in RGB pixel writing.

Mans Rullgard git at videolan.org
Sun Dec 18 03:12:22 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sat Dec 17 18:45:46 2011 +0000| [77d88b872d8cbb42738ede2d4fc098c16f204236] | committer: Mans Rullgard

swscale: fix integer overflows in RGB pixel writing.

We're shifting individual components (8-bit, unsigned) left by 24,
so making them unsigned should give the same results without the
overflow.

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>

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

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

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 818c049..3ea3710 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -920,8 +920,8 @@ YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)
 YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)
 
 static av_always_inline void
-yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
-              int U, int V, int A1, int A2,
+yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2,
+              unsigned U, unsigned V, unsigned A1, unsigned A2,
               const void *_r, const void *_g, const void *_b, int y,
               enum PixelFormat target, int hasAlpha)
 {



More information about the ffmpeg-cvslog mailing list