Return error for invalid crop parameters

Test: run poc with and without the patch
Bug: 62214264
Change-Id: If627ee9a8f0dbd65963897966e1c2d39f5fbd428
This commit is contained in:
Naveen Kumar P 2017-05-17 14:07:54 +05:30 committed by Dongwon Kang
parent 4bdf5678de
commit e8c26c16d7

View file

@ -1293,15 +1293,31 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
{
UEV_PARSE("pic_crop_left_offset", value, ps_bitstrm);
if (value >= ps_sps->i2_pic_width_in_luma_samples)
{
return IHEVCD_INVALID_PARAMETER;
}
ps_sps->i2_pic_crop_left_offset = value;
UEV_PARSE("pic_crop_right_offset", value, ps_bitstrm);
if (value >= ps_sps->i2_pic_width_in_luma_samples)
{
return IHEVCD_INVALID_PARAMETER;
}
ps_sps->i2_pic_crop_right_offset = value;
UEV_PARSE("pic_crop_top_offset", value, ps_bitstrm);
if (value >= ps_sps->i2_pic_height_in_luma_samples)
{
return IHEVCD_INVALID_PARAMETER;
}
ps_sps->i2_pic_crop_top_offset = value;
UEV_PARSE("pic_crop_bottom_offset", value, ps_bitstrm);
if (value >= ps_sps->i2_pic_height_in_luma_samples)
{
return IHEVCD_INVALID_PARAMETER;
}
ps_sps->i2_pic_crop_bottom_offset = value;
}
else