[Ffmpeg-cvslog] r7324 - trunk/libavcodec/vc1.c

reimar subversion
Sun Dec 17 12:11:44 CET 2006


Author: reimar
Date: Sun Dec 17 12:11:44 2006
New Revision: 7324

Modified:
   trunk/libavcodec/vc1.c

Log:
Check mb_pos is big enough before trying to access data left or above.
Fixes out-of-bound access for http://samples.mplayerhq.hu/V-codecs/WMV9/nokia_n90.wmv


Modified: trunk/libavcodec/vc1.c
==============================================================================
--- trunk/libavcodec/vc1.c	(original)
+++ trunk/libavcodec/vc1.c	Sun Dec 17 12:11:44 2006
@@ -3072,8 +3072,8 @@
         ac_val -= 16 * s->block_wrap[n];
 
     q1 = s->current_picture.qscale_table[mb_pos];
-    if(dc_pred_dir && c_avail) q2 = s->current_picture.qscale_table[mb_pos - 1];
-    if(!dc_pred_dir && a_avail) q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
+    if(dc_pred_dir && c_avail && mb_pos) q2 = s->current_picture.qscale_table[mb_pos - 1];
+    if(!dc_pred_dir && a_avail && mb_pos >= s->mb_stride) q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
     if(n && n<4) q2 = q1;
 
     if(coded) {




More information about the ffmpeg-cvslog mailing list