[FFmpeg-cvslog] avcodec/pngdec: fix signed overflow

Michael Niedermayer git at videolan.org
Wed Dec 18 22:24:11 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 18 22:15:32 2013 +0100| [cb079b1b2bb1f7d0609ea7196090802a2788913a] | committer: Michael Niedermayer

avcodec/pngdec: fix signed overflow

fixes fate ftrapv failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/pngdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 3d21e50..516dd41 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -226,7 +226,7 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
         if (bpp == 4) {
             p = *(int*)dst;
             for (; i < size; i += bpp) {
-                int s = *(int*)(src + i);
+                unsigned s = *(int*)(src + i);
                 p = ((s & 0x7f7f7f7f) + (p & 0x7f7f7f7f)) ^ ((s ^ p) & 0x80808080);
                 *(int*)(dst + i) = p;
             }



More information about the ffmpeg-cvslog mailing list