comparison mpegvideo.c @ 5955:bd9a68cc9a17 libavcodec

fix segfault with interlaced h.264
author michael
date Thu, 29 Nov 2007 15:09:24 +0000
parents da358b2602ce
children 52ccab2531bd
comparison
equal deleted inserted replaced
5954:aafe67fa196f 5955:bd9a68cc9a17
227 CHECKED_ALLOCZ(pic->mb_mean , mb_array_size * sizeof(int8_t)) 227 CHECKED_ALLOCZ(pic->mb_mean , mb_array_size * sizeof(int8_t))
228 } 228 }
229 229
230 CHECKED_ALLOCZ(pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2) //the +2 is for the slice end check 230 CHECKED_ALLOCZ(pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2) //the +2 is for the slice end check
231 CHECKED_ALLOCZ(pic->qscale_table , mb_array_size * sizeof(uint8_t)) 231 CHECKED_ALLOCZ(pic->qscale_table , mb_array_size * sizeof(uint8_t))
232 CHECKED_ALLOCZ(pic->mb_type_base , big_mb_num * sizeof(uint32_t)) 232 CHECKED_ALLOCZ(pic->mb_type_base , (big_mb_num + s->mb_stride) * sizeof(uint32_t))
233 pic->mb_type= pic->mb_type_base + s->mb_stride+1; 233 pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1;
234 if(s->out_format == FMT_H264){ 234 if(s->out_format == FMT_H264){
235 for(i=0; i<2; i++){ 235 for(i=0; i<2; i++){
236 CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t)) 236 CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t))
237 pic->motion_val[i]= pic->motion_val_base[i]+4; 237 pic->motion_val[i]= pic->motion_val_base[i]+4;
238 CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t)) 238 CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))