From d7eee555dc124a4ab7977f073c6b4a76c346f760 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Mon, 5 Dec 2016 13:36:19 +0530 Subject: [PATCH] Decoder: Fix in checking for valid profile flags Apart from Baseline, main and high profile, only extended profile is supported provided, constraint_set0_flag or constraint_set1_flag are set to 1 Bug: 31999646 Change-Id: I3b62069efc49e222a7126fba0805fa9124aac8f2 --- decoder/ih264d_defs.h | 1 + decoder/ih264d_parse_headers.c | 18 +++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/decoder/ih264d_defs.h b/decoder/ih264d_defs.h index fbdbd45..6826baa 100644 --- a/decoder/ih264d_defs.h +++ b/decoder/ih264d_defs.h @@ -257,6 +257,7 @@ enum /** Profile Types*/ #define BASE_PROFILE_IDC 66 #define MAIN_PROFILE_IDC 77 +#define EXTENDED_PROFILE_IDC 88 #define HIGH_PROFILE_IDC 100 diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c index 5f82110..3f1dcad 100644 --- a/decoder/ih264d_parse_headers.c +++ b/decoder/ih264d_parse_headers.c @@ -533,18 +533,14 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm) ) { - if((uc_constraint_set1_flag != 1) && (uc_constraint_set0_flag != 1)) + /* Apart from Baseline, main and high profile, + * only extended profile is supported provided + * uc_constraint_set0_flag or uc_constraint_set1_flag are set to 1 + */ + if((u1_profile_idc != EXTENDED_PROFILE_IDC) || + ((uc_constraint_set1_flag != 1) && (uc_constraint_set0_flag != 1))) { - if(NULL != ps_dec) - { - UWORD32 i4_error_code; - i4_error_code = ERROR_FEATURE_UNAVAIL; - return i4_error_code; - } - else - { - return (ERROR_FEATURE_UNAVAIL); - } + return (ERROR_FEATURE_UNAVAIL); } }