aboutsummaryrefslogtreecommitdiff
path: root/decoder/ihevcd_parse_headers.c
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/ihevcd_parse_headers.c')
-rw-r--r--decoder/ihevcd_parse_headers.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c
index c9b2fbe..9059a5b 100644
--- a/decoder/ihevcd_parse_headers.c
+++ b/decoder/ihevcd_parse_headers.c
@@ -1424,9 +1424,17 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
ps_sps->i1_log2_diff_max_min_pcm_coding_block_size = 0;
UEV_PARSE("max_transform_hierarchy_depth_inter", value, ps_bitstrm);
+ if(value < 0 || value > (ps_sps->i1_log2_ctb_size - ps_sps->i1_log2_min_transform_block_size))
+ {
+ return IHEVCD_INVALID_PARAMETER;
+ }
ps_sps->i1_max_transform_hierarchy_depth_inter = value;
UEV_PARSE("max_transform_hierarchy_depth_intra", value, ps_bitstrm);
+ if(value < 0 || value > (ps_sps->i1_log2_ctb_size - ps_sps->i1_log2_min_transform_block_size))
+ {
+ return IHEVCD_INVALID_PARAMETER;
+ }
ps_sps->i1_max_transform_hierarchy_depth_intra = value;
/* String has a d (enabled) in order to match with HM */