Mercurial > libavcodec.hg
comparison vc1.c @ 4303:7e907f7d6a21 libavcodec
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
author | reimar |
---|---|
date | Sun, 17 Dec 2006 11:11:44 +0000 |
parents | d6f83e2f8804 |
children | 05e932ddaaa9 |
comparison
equal
deleted
inserted
replaced
4302:a0f83004d485 | 4303:7e907f7d6a21 |
---|---|
3070 ac_val -= 16; | 3070 ac_val -= 16; |
3071 else //top | 3071 else //top |
3072 ac_val -= 16 * s->block_wrap[n]; | 3072 ac_val -= 16 * s->block_wrap[n]; |
3073 | 3073 |
3074 q1 = s->current_picture.qscale_table[mb_pos]; | 3074 q1 = s->current_picture.qscale_table[mb_pos]; |
3075 if(dc_pred_dir && c_avail) q2 = s->current_picture.qscale_table[mb_pos - 1]; | 3075 if(dc_pred_dir && c_avail && mb_pos) q2 = s->current_picture.qscale_table[mb_pos - 1]; |
3076 if(!dc_pred_dir && a_avail) q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride]; | 3076 if(!dc_pred_dir && a_avail && mb_pos >= s->mb_stride) q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride]; |
3077 if(n && n<4) q2 = q1; | 3077 if(n && n<4) q2 = q1; |
3078 | 3078 |
3079 if(coded) { | 3079 if(coded) { |
3080 int last = 0, skip, value; | 3080 int last = 0, skip, value; |
3081 const int8_t *zz_table; | 3081 const int8_t *zz_table; |