mirror of https://git.ffmpeg.org/ffmpeg.git
h264: only allow ending a field/starting a new one before finish_setup()
Doing this after ff_thread_finish_setup() is called is invalid and can conflict with reads from the other thread.
This commit is contained in:
parent
debca90863
commit
17e7c03e12
|
@ -1381,6 +1381,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (!h->setup_finished) {
|
||||||
if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
|
if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
|
||||||
if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
|
if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
|
||||||
ff_h264_field_end(h, sl, 1);
|
ff_h264_field_end(h, sl, 1);
|
||||||
|
@ -1400,7 +1401,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
|
||||||
ret = h264_field_start(h, sl, nal);
|
ret = h264_field_start(h, sl, nal);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (h->current_slice > 0) {
|
||||||
if (h->ps.pps != (const PPS*)h->ps.pps_list[sl->pps_id]->data) {
|
if (h->ps.pps != (const PPS*)h->ps.pps_list[sl->pps_id]->data) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
|
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
Loading…
Reference in New Issue