Commit ef872512 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/motion_est: Only clip MVs which are used

Fixes valgrind mpeg4 failures
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent edeefeaa
......@@ -620,7 +620,11 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
P_MV1[0]= mx;
P_MV1[1]= my;
if(saftey_cliping)
for(i=0; i<10; i++){
for(i=1; i<10; i++){
if (s->first_slice_line && block<2 && i>1 && i<9)
continue;
if (i>4 && i<9)
continue;
if(P[i][0] > (c->xmax<<shift)) P[i][0]= (c->xmax<<shift);
if(P[i][1] > (c->ymax<<shift)) P[i][1]= (c->ymax<<shift);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment