diff options
author | Naveen Kumar P <naveenkumar.p@ittiam.com> | 2017-07-06 16:11:17 +0530 |
---|---|---|
committer | Ivan Kutepov <its.kutepov@gmail.com> | 2018-02-08 02:22:25 +0300 |
commit | 455a13288143432c4a7625ee9610d5822af8f085 (patch) | |
tree | 668237598ed953753fa336374cd2d3a2d64f1a80 | |
parent | 01740dc72236c48f4a503b0b468277ed0dad765d (diff) | |
download | android_external_libhevc-455a13288143432c4a7625ee9610d5822af8f085.tar.gz android_external_libhevc-455a13288143432c4a7625ee9610d5822af8f085.tar.bz2 android_external_libhevc-455a13288143432c4a7625ee9610d5822af8f085.zip |
Check if luma wd and ht are multiple of min cb size
Bug: 65483665
Instead of aligning width and height to 8, it is now
checked for being a multiple of min CB size
Change-Id: I99bf60e19d490fd06933aa01fa6a34f47fe58bb4
(cherry picked from commit ccfd1ea5c4cf9cf0a55088506ae5f312663f8792)
CVE-2017-13230
-rw-r--r-- | decoder/ihevcd_parse_headers.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c index c62fda9..8e122c1 100644 --- a/decoder/ihevcd_parse_headers.c +++ b/decoder/ihevcd_parse_headers.c @@ -1270,12 +1270,6 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) if((0 >= ps_sps->i2_pic_width_in_luma_samples) || (0 >= ps_sps->i2_pic_height_in_luma_samples)) return IHEVCD_INVALID_PARAMETER; - /* i2_pic_width_in_luma_samples and i2_pic_height_in_luma_samples - should be multiples of min_cb_size. Here these are aligned to 8, - i.e. smallest CB size */ - ps_sps->i2_pic_width_in_luma_samples = ALIGN8(ps_sps->i2_pic_width_in_luma_samples); - ps_sps->i2_pic_height_in_luma_samples = ALIGN8(ps_sps->i2_pic_height_in_luma_samples); - BITS_PARSE("pic_cropping_flag", value, ps_bitstrm, 1); ps_sps->i1_pic_cropping_flag = value; @@ -1416,7 +1410,9 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) (ps_sps->i1_log2_diff_max_min_transform_block_size < 0) || (ps_sps->i1_log2_max_transform_block_size > ps_sps->i1_log2_ctb_size) || (ps_sps->i1_log2_ctb_size < 4) || - (ps_sps->i1_log2_ctb_size > 6)) + (ps_sps->i1_log2_ctb_size > 6) || + (ps_sps->i2_pic_width_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0) || + (ps_sps->i2_pic_height_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0)) { return IHEVCD_INVALID_PARAMETER; } |