[Ffmpeg-devel] WMV3 segfaults in vc1_decode_intra_block()

Reimar Döffinger Reimar.Doeffinger
Sat Dec 16 16:45:47 CET 2006


Hello,
On Mon, Dec 11, 2006 at 01:08:22PM +0200, Nikns Siankin wrote:
> Sample: http://pazeme.lv/nokia_n90.wmv

No crash, but valgrind complains for me.
Attached patch fixes.
Any comments?
Maybe testing for
s->mb_y
instead of
mb_pos > s->mb_stride
would be better though.

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/vc1.c
===================================================================
--- libavcodec/vc1.c	(revision 7322)
+++ libavcodec/vc1.c	(working copy)
@@ -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-devel mailing list