diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 20136704d4..7c303d6ad4 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -391,7 +391,8 @@ int ff_h264_decode_seq_parameter_set(H264Context *h) "Different chroma and luma bit depth"); goto fail; } - if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) { + if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 || + sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14) { av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n", sps->bit_depth_luma, sps->bit_depth_chroma); goto fail;