Commit accc9164 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/h264_slice: do not skip 2nd field if first was not skipped

Found-by: 's avatarJohn Högberg <john.hogberg@ericsson.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9c41126e
...@@ -1212,14 +1212,16 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl) ...@@ -1212,14 +1212,16 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if ( if (h->current_slice == 0 && !h->first_field) {
(h->avctx->skip_frame >= AVDISCARD_NONREF && !h->nal_ref_idc) || if (
(h->avctx->skip_frame >= AVDISCARD_BIDIR && sl->slice_type_nos == AV_PICTURE_TYPE_B) || (h->avctx->skip_frame >= AVDISCARD_NONREF && !h->nal_ref_idc) ||
(h->avctx->skip_frame >= AVDISCARD_NONINTRA && sl->slice_type_nos != AV_PICTURE_TYPE_I) || (h->avctx->skip_frame >= AVDISCARD_BIDIR && sl->slice_type_nos == AV_PICTURE_TYPE_B) ||
(h->avctx->skip_frame >= AVDISCARD_NONKEY && h->nal_unit_type != NAL_IDR_SLICE) || (h->avctx->skip_frame >= AVDISCARD_NONINTRA && sl->slice_type_nos != AV_PICTURE_TYPE_I) ||
h->avctx->skip_frame >= AVDISCARD_ALL) { (h->avctx->skip_frame >= AVDISCARD_NONKEY && h->nal_unit_type != NAL_IDR_SLICE) ||
return SLICE_SKIPED; h->avctx->skip_frame >= AVDISCARD_ALL) {
} return SLICE_SKIPED;
}
}
// to make a few old functions happy, it's wrong though // to make a few old functions happy, it's wrong though
if (!h->setup_finished) if (!h->setup_finished)
......
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