Check limits for log2_max_pic_order_cnt_lsb_minus4 in sps Bug: 71766721 According to the spec, the value of log2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12, inclusive. Change-Id: Ibd199b6dea246c2fac6214c21e49f27d95c07659 (cherry picked from commit 4d32ff55cf3eeeb3a319517176ed2a2c6c376fe1)
diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c index a8daa3c..b8ed252 100644 --- a/decoder/ihevcd_parse_headers.c +++ b/decoder/ihevcd_parse_headers.c
@@ -1402,6 +1402,8 @@ return IHEVCD_UNSUPPORTED_BIT_DEPTH; UEV_PARSE("log2_max_pic_order_cnt_lsb_minus4", value, ps_bitstrm); + if(value < 0 || value > 12) + return IHEVCD_INVALID_PARAMETER; ps_sps->i1_log2_max_pic_order_cnt_lsb = value + 4; BITS_PARSE("sps_sub_layer_ordering_info_present_flag", value, ps_bitstrm, 1);