changeset 2818:cdc7a2341165 libavcodec

segfault fix
author michael
date Thu, 04 Aug 2005 22:46:27 +0000
parents b128802eb77b
children 4f14a3062d0a
files wmv2.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/wmv2.c	Mon Aug 01 20:07:05 2005 +0000
+++ b/wmv2.c	Thu Aug 04 22:46:27 2005 +0000
@@ -513,9 +513,12 @@
     B = s->current_picture.motion_val[0][xy - wrap];
     C = s->current_picture.motion_val[0][xy + 2 - wrap];
     
-    diff= FFMAX(ABS(A[0] - B[0]), ABS(A[1] - B[1]));
+    if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
+        diff= FFMAX(ABS(A[0] - B[0]), ABS(A[1] - B[1]));
+    else 
+        diff=0;
     
-    if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag && diff >= 8)
+    if(diff >= 8)
         type= get_bits1(&s->gb);
     else
         type= 2;