- ff_h264_set_erpic(&h->er.last_pic, &h->last_pic_for_ec);
- COPY_PICTURE(&h->ref_list[0][0], &h->last_pic_for_ec);
- } else if (h->ref_count[0]) {
- ff_h264_set_erpic(&h->er.last_pic, &h->ref_list[0][0]);
+ ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
+ sl->ref_list[0][0].parent = &h->last_pic_for_ec;
+ memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f.data, sizeof(sl->ref_list[0][0].data));
+ memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f.linesize, sizeof(sl->ref_list[0][0].linesize));
+ sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
+ } else if (sl->ref_count[0]) {
+ ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);