avcodec/pngdec: fix signed overflow

fixes fate ftrapv failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/51/head
Michael Niedermayer 11 years ago
parent 03a5c44fae
commit cb079b1b2b
  1. 2
      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;
}

Loading…
Cancel
Save