aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-01-03 11:32:02 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-01-03 11:32:02 +0000
commitbc9a459780178ec17a2b1e5f7d8f76fad3c2c156 (patch)
tree63e848454f246a22d7f4bd3e20e283b96bbb0aac
parent78954a0542634e88050a3491a2866d817df19527 (diff)
downloadffmpeg-bc9a459780178ec17a2b1e5f7d8f76fad3c2c156.tar.gz
maybe fixing a segfault
Originally committed as revision 7407 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/wmv2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index 5abc517752..f3d4f0f23d 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -643,6 +643,12 @@ void ff_mspel_motion(MpegEncContext *s,
v_edge_pos = s->v_edge_pos;
src_x = clip(src_x, -16, s->width);
src_y = clip(src_y, -16, s->height);
+
+ if(src_x<=-16 || src_x >= s->width)
+ dxy &= ~3;
+ if(src_y<=-16 || src_y >= s->height)
+ dxy &= ~4;
+
linesize = s->linesize;
uvlinesize = s->uvlinesize;
ptr = ref_picture[0] + (src_y * linesize) + src_x;