aboutsummaryrefslogtreecommitdiff
path: root/decoder/ihevcd_parse_headers.c
diff options
context:
space:
mode:
authorNaveen Kumar P <naveenkumar.p@ittiam.com>2017-10-12 15:28:20 +0530
committerSungtak Lee <taklee@google.com>2017-11-02 20:39:52 +0000
commit978d3320ef3dc60f69f8c4ba215b869d11b03944 (patch)
treecfed9ab8092a324238959ac7fb7ae8f3109ff45d /decoder/ihevcd_parse_headers.c
parent27e8401a7c7bcf35d5dfa17a033e0ae5af02670c (diff)
downloadlibhevc-978d3320ef3dc60f69f8c4ba215b869d11b03944.tar.gz
Return error for negative crop parameters
Bug: 65398821 Change-Id: I18a94d40d77504bb9c9d5a5e7bf41207aed28712 Signed-off-by: Sungtak Lee <taklee@google.com>
Diffstat (limited to 'decoder/ihevcd_parse_headers.c')
-rw-r--r--decoder/ihevcd_parse_headers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c
index d331a39..6a99248 100644
--- a/decoder/ihevcd_parse_headers.c
+++ b/decoder/ihevcd_parse_headers.c
@@ -1286,28 +1286,28 @@ 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)
+ if (value < 0 || 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)
+ if (value < 0 || 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)
+ if (value < 0 || 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)
+ if (value < 0 || value >= ps_sps->i2_pic_height_in_luma_samples)
{
return IHEVCD_INVALID_PARAMETER;
}