# HG changeset patch # User kostya # Date 1154316779 0 # Node ID b8656dfe6b1a35f48a6b6c26aa6b0bfd6d36f77d # Parent 79ad5cd4368655400b2f59c6ce2e76fe3319beb8 Fix overflows in bicubic interpolation. diff -r 79ad5cd43686 -r b8656dfe6b1a vc1dsp.c --- a/vc1dsp.c Sun Jul 30 03:50:31 2006 +0000 +++ b/vc1dsp.c Mon Jul 31 03:32:59 2006 +0000 @@ -314,7 +314,7 @@ /** Filter used to interpolate fractional pel values */ -static always_inline uint8_t vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r) +static always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r) { switch(mode){ case 0: //no shift @@ -343,7 +343,7 @@ tptr = tmp; for(j = 0; j < 11; j++) { for(i = 0; i < 8; i++) - tptr[i] = vc1_mspel_filter(src + i, 1, m, r); + tptr[i] = clip_uint8(vc1_mspel_filter(src + i, 1, m, r)); src += stride; tptr += 8; } @@ -353,7 +353,7 @@ tptr = tmp + 8; for(j = 0; j < 8; j++) { for(i = 0; i < 8; i++) - dst[i] = vc1_mspel_filter(tptr + i, 8, m, r); + dst[i] = clip_uint8(vc1_mspel_filter(tptr + i, 8, m, r)); dst += stride; tptr += 8; }