aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1dsp.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2009-01-28 11:12:19 +0000
committerLoren Merritt <lorenm@u.washington.edu>2009-01-28 11:12:19 +0000
commit5a446bc88e49cc6400d0c646ca1eb540a727c9de (patch)
tree20d21d964b5d1a7b45fd35480879bc448f2ff4d0 /libavcodec/vc1dsp.c
parentb69201a82c4fdc5d8110f693e7571611c3c8da6f (diff)
downloadffmpeg-5a446bc88e49cc6400d0c646ca1eb540a727c9de.tar.gz
fix an overflow in vc1 intra overlap filter
Originally committed as revision 16845 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r--libavcodec/vc1dsp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index 8a1a83411f..5868abbb88 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -45,8 +45,8 @@ static void vc1_v_overlap_c(uint8_t* src, int stride)
d2 = (a - d + b - c + 4 - rnd) >> 3;
src[-2*stride] = a - d1;
- src[-stride] = b - d2;
- src[0] = c + d2;
+ src[-stride] = av_clip_uint8(b - d2);
+ src[0] = av_clip_uint8(c + d2);
src[stride] = d + d1;
src++;
rnd = !rnd;
@@ -70,8 +70,8 @@ static void vc1_h_overlap_c(uint8_t* src, int stride)
d2 = (a - d + b - c + 4 - rnd) >> 3;
src[-2] = a - d1;
- src[-1] = b - d2;
- src[0] = c + d2;
+ src[-1] = av_clip_uint8(b - d2);
+ src[0] = av_clip_uint8(c + d2);
src[1] = d + d1;
src += stride;
rnd = !rnd;