aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2006-07-31 03:32:59 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2006-07-31 03:32:59 +0000
commita70c27e813346a11e5fff3d329ecba82fb76826a (patch)
treee0b169171f59c61279a0e4394e7591ea4ba3210b
parent5b01f9ce4737d4520f4bd23a67a1609baaee025b (diff)
downloadffmpeg-a70c27e813346a11e5fff3d329ecba82fb76826a.tar.gz
Fix overflows in bicubic interpolation.
Originally committed as revision 5868 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/vc1dsp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index befd60c1c9..16fe31b90d 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -314,7 +314,7 @@ static void vc1_inv_trans_4x4_c(DCTELEM block[64], int n)
/** 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 @@ static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode,
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 @@ static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode,
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;
}