aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2019-09-13 16:52:49 -0700
committerHuizi Yang <yanghuiz@google.com>2019-10-08 14:05:53 -0700
commit3bd53bf6b46a3ff1c2189ad15a86678deb4d1c5f (patch)
treecd1ce5420017a9921c0102213467bbe8e04761ed
parentab13b0278538291dfb932481236c0ad807616191 (diff)
downloadlibhevc-3bd53bf6b46a3ff1c2189ad15a86678deb4d1c5f.tar.gz
If an SPS is being overwritten, ensure CTB size remains same. If not, return from decoder and reset the decoder state in the subsequent decode call. Bug: 140322595 Test: poc in bug Change-Id: Ie1a18b18704d6ef099535149fe21a1921bcbeeaf Merged-In: I5f1e52d3bd2b48874a088ab32054f5a89e62eeb5 (cherry picked from commit 072f9084f42730094e6d3cecf6078b3830577da6)
-rw-r--r--decoder/ihevcd_parse_headers.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c
index 47edb1f..09f343c 100644
--- a/decoder/ihevcd_parse_headers.c
+++ b/decoder/ihevcd_parse_headers.c
@@ -1473,7 +1473,19 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
ps_sps->i1_log2_diff_max_min_coding_block_size = value;
ctb_log2_size_y = ps_sps->i1_log2_min_coding_block_size + ps_sps->i1_log2_diff_max_min_coding_block_size;
-
+ /* Check if CTB size is different in case of multiple SPS with same ID */
+ {
+ sps_t *ps_sps_old = (ps_codec->s_parse.ps_sps_base + sps_id);
+ if(ps_sps_old->i1_sps_valid && ps_sps_old->i1_log2_ctb_size != ctb_log2_size_y)
+ {
+ if(0 == ps_codec->i4_first_pic_done)
+ {
+ return IHEVCD_INVALID_PARAMETER;
+ }
+ ps_codec->i4_reset_flag = 1;
+ return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
+ }
+ }
UEV_PARSE("log2_min_transform_block_size_minus2", value, ps_bitstrm);
if(value > (LOG2_MAX_TU_SIZE - 2))
{