Revision 7c4f71c4 libavcodec/mpegvideo.c

View differences:

libavcodec/mpegvideo.c
307 307
                memcpy(dst->motion_val[i], src->motion_val[i], 2*stride*height*sizeof(int16_t));
308 308
            }
309 309
            if(src->ref_index[i] && src->ref_index[i] != dst->ref_index[i]){
310
                memcpy(dst->ref_index[i], src->ref_index[i], s->mb_stride*s->mb_height*sizeof(int8_t)); //FIXME init this too
310
                memcpy(dst->ref_index[i], src->ref_index[i], s->b8_stride*2*s->mb_height*sizeof(int8_t));
311 311
            }
312 312
        }
313 313
    }
......
369 369
            for(i=0; i<2; i++){
370 370
                CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b4_array_size+2)  * sizeof(int16_t))
371 371
                pic->motion_val[i]= pic->motion_val_base[i]+2;
372
                CHECKED_ALLOCZ(pic->ref_index[i] , b8_array_size * sizeof(uint8_t))
372
                CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))
373 373
            }
374 374
            pic->motion_subsample_log2= 2;
375 375
        }else if(s->out_format == FMT_H263 || s->encoding || (s->avctx->debug&FF_DEBUG_MV) || (s->avctx->debug_mv)){
376 376
            for(i=0; i<2; i++){
377 377
                CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b8_array_size+2) * sizeof(int16_t))
378 378
                pic->motion_val[i]= pic->motion_val_base[i]+2;
379
                CHECKED_ALLOCZ(pic->ref_index[i], mb_array_size * sizeof(int8_t))
379
                CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))
380 380
            }
381 381
            pic->motion_subsample_log2= 3;
382 382
        }

Also available in: Unified diff