From ebee97d75a255cc7f308be32cd54ea92ad76c019 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Wed, 5 Aug 2026 10:07:32 -0700 Subject: [PATCH] Limit support to max bit depth of 10-bit --- decoder/ihevcd_parse_headers.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c index 490f9b8..af00123 100644 --- a/decoder/ihevcd_parse_headers.c +++ b/decoder/ihevcd_parse_headers.c @@ -1735,6 +1735,10 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) UEV_PARSE("bit_depth_luma_minus8", value, ps_bitstrm); + // Limit the support to max bit depth of 10-bit + if (value > 2) + return IHEVCD_UNSUPPORTED_BIT_DEPTH; + if ( ((1 == i4_profile_idc) && (0 != value)) || ((2 == i4_profile_idc) && (2 < value)) || ((4 == i4_profile_idc) && (4 < value)) ) return IHEVCD_UNSUPPORTED_BIT_DEPTH; @@ -1744,6 +1748,10 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) ps_sps->i1_bit_depth_luma_minus8 = value; UEV_PARSE("bit_depth_chroma_minus8", value, ps_bitstrm); + // Limit the support to max bit depth of 10-bit + if (value > 2) + return IHEVCD_UNSUPPORTED_BIT_DEPTH; + if ( ((1 == i4_profile_idc) && (0 != value)) || ((2 == i4_profile_idc) && (2 < value)) || ((4 == i4_profile_idc) && (4 < value)) ) return IHEVCD_UNSUPPORTED_BIT_DEPTH;