avcodec/pngdec: fix signed overflow
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Dec 2013 21:15:32 +0000 (22:15 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Dec 2013 21:15:32 +0000 (22:15 +0100)
fixes fate ftrapv failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c

index 3d21e50..516dd41 100644 (file)
@@ -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;
             }