Return error for invalid sps sub layers parameters

Return error for negative values of max_dec_pic_buffering and
num_reorder_pics sps parameters.

Bug: 73965867
Test: Ittiam
Change-Id: I6035b3b2fcbd29c6bbb1223f4714ba04b4bca6b3
This commit is contained in:
Naveen Kumar P 2018-03-09 08:34:01 +05:30 committed by Ray Essick
parent 4286d31e9e
commit f4486cdb2f

View file

@ -1343,14 +1343,14 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
for(; i < ps_sps->i1_sps_max_sub_layers; i++)
{
UEV_PARSE("max_dec_pic_buffering", value, ps_bitstrm);
if((value + 1) > MAX_DPB_SIZE)
if(value < 0 || (value + 1) > MAX_DPB_SIZE)
{
return IHEVCD_INVALID_PARAMETER;
}
ps_sps->ai1_sps_max_dec_pic_buffering[i] = value + 1;
UEV_PARSE("num_reorder_pics", value, ps_bitstrm);
if(value > ps_sps->ai1_sps_max_dec_pic_buffering[i])
if(value < 0 || value > ps_sps->ai1_sps_max_dec_pic_buffering[i])
{
return IHEVCD_INVALID_PARAMETER;
}