Commit a60abb1e authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'bfd26b7c'

* commit 'bfd26b7c':
  h264: reject mismatching luma/chroma bit depths during sps parsing

Conflicts:
	libavcodec/h264_ps.c

See: bdeb61ccMerged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 98dcbb47 bfd26b7c
......@@ -3115,12 +3115,6 @@ static int h264_set_parameter_from_sps(H264Context *h)
if (h->avctx->has_b_frames < 2)
h->avctx->has_b_frames = !h->low_delay;
if (h->sps.bit_depth_luma != h->sps.bit_depth_chroma) {
avpriv_request_sample(h->avctx,
"Different chroma and luma bit depth");
return AVERROR_PATCHWELCOME;
}
if (h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
h->cur_chroma_format_idc != h->sps.chroma_format_idc) {
if (h->avctx->codec &&
......
......@@ -376,7 +376,12 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
}
sps->bit_depth_luma = get_ue_golomb(&h->gb) + 8;
sps->bit_depth_chroma = get_ue_golomb(&h->gb) + 8;
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U || sps->bit_depth_luma != sps->bit_depth_chroma) {
if (sps->bit_depth_chroma != sps->bit_depth_luma) {
avpriv_request_sample(h->avctx,
"Different chroma and luma bit depth");
goto fail;
}
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
sps->bit_depth_luma, sps->bit_depth_chroma);
goto fail;
......
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