aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/motion_est_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-06-10 22:56:43 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-06-10 22:56:43 +0000
commitae1dbde1cf6a9a96d802dc38b6741824857b24c5 (patch)
treec712b59cd55251cd9920147bb6b2b56a01d5134a /libavcodec/motion_est_template.c
parentc60d6ad4bc3dbb9023c937bb472b427a2968deb2 (diff)
downloadffmpeg-ae1dbde1cf6a9a96d802dc38b6741824857b24c5.tar.gz
clip input motion vectors
be somewhat more tollerant on invalid input return INT_MAX instead of -1 for unuseable mv/mb types as that ensures nicely that they arent used initalize limits earlier for b frames a few more asserts to check for out of picture vectors Originally committed as revision 3213 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est_template.c')
-rw-r--r--libavcodec/motion_est_template.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index 8cfb249553..fd293fa2fd 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -487,6 +487,10 @@ static int qpel_motion_search(MpegEncContext * s,
{\
const int key= ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
+ assert((x) >= xmin);\
+ assert((x) <= xmax);\
+ assert((y) >= ymin);\
+ assert((y) <= ymax);\
/*printf("check_mv %d %d\n", x, y);*/\
if(map[index]!=key){\
d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\