Commit 141b9d5c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/h264_slice: update slice context linesizes when a new picture is allocated

previously they where only updated when decoding started and would thus have
been inconsistent for a longer period of time leaving more chances for
problems
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fa7c08d5
...@@ -711,6 +711,11 @@ static int h264_frame_start(H264Context *h) ...@@ -711,6 +711,11 @@ static int h264_frame_start(H264Context *h)
if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0) if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
return ret; return ret;
for (i = 0; i < h->nb_slice_ctx; i++) {
h->slice_ctx[i].linesize = h->cur_pic_ptr->f.linesize[0];
h->slice_ctx[i].uvlinesize = h->cur_pic_ptr->f.linesize[1];
}
if (CONFIG_ERROR_RESILIENCE) { if (CONFIG_ERROR_RESILIENCE) {
ff_er_frame_start(&h->slice_ctx[0].er); ff_er_frame_start(&h->slice_ctx[0].er);
ff_h264_set_erpic(&h->slice_ctx[0].er.last_pic, NULL); ff_h264_set_erpic(&h->slice_ctx[0].er.last_pic, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment