# HG changeset patch # User michael # Date 1196348964 0 # Node ID bd9a68cc9a17a6ce6ed29c909ba8e1e72ffb35fe # Parent aafe67fa196f307940dacb5516953b38cf7977c1 fix segfault with interlaced h.264 diff -r aafe67fa196f -r bd9a68cc9a17 mpegvideo.c --- a/mpegvideo.c Wed Nov 28 14:27:53 2007 +0000 +++ b/mpegvideo.c Thu Nov 29 15:09:24 2007 +0000 @@ -229,8 +229,8 @@ CHECKED_ALLOCZ(pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2) //the +2 is for the slice end check CHECKED_ALLOCZ(pic->qscale_table , mb_array_size * sizeof(uint8_t)) - CHECKED_ALLOCZ(pic->mb_type_base , big_mb_num * sizeof(uint32_t)) - pic->mb_type= pic->mb_type_base + s->mb_stride+1; + CHECKED_ALLOCZ(pic->mb_type_base , (big_mb_num + s->mb_stride) * sizeof(uint32_t)) + pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1; if(s->out_format == FMT_H264){ for(i=0; i<2; i++){ CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t))