aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2019-04-16 10:51:53 -0700
committerRay Essick <essick@google.com>2019-04-30 17:14:01 -0700
commit54160a6d3e6528d75f609f511cea0c8d447de1fa (patch)
treee2fcaebbea5081b8b97f722e5f3a96147a91d7d4
parentfabba6afaf8d870e4c92d9e0c0e2f622625718b9 (diff)
downloadlibavc-54160a6d3e6528d75f609f511cea0c8d447de1fa.tar.gz
decoder: Treat unsupported feature errors as fatal errors
This will ensure clips with supported bitdepth or unsupport color formats are not attempted to be decoded till end of the sequence. Bug: 130578045 Test: adb shell stagefright -s -S /sdcard/crowd422_h264.mp4 Test: Ensure decoder doesn't attemp decoding all frames Change-Id: I118ef2141f77986f6ec65c91dfeaa7ef17646c43
-rw-r--r--decoder/ih264d.h1
-rw-r--r--decoder/ih264d_api.c7
-rw-r--r--decoder/ih264d_parse_headers.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/decoder/ih264d.h b/decoder/ih264d.h
index 7c76296..83f8a1f 100644
--- a/decoder/ih264d.h
+++ b/decoder/ih264d.h
@@ -50,6 +50,7 @@ extern "C" {
/*****************************************************************************/
/* Constant Macros */
/*****************************************************************************/
+#define IVD_ERROR_MASK 0xFF
/*****************************************************************************/
/* Function Macros */
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 25ead89..dc31632 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -1549,7 +1549,7 @@ WORD32 ih264d_create(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
}
}
ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
- ps_create_op->s_ivd_create_op_t.u4_error_code = 1 << IVD_FATALERROR;
+ ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
return IV_FAIL;
}
@@ -1591,6 +1591,8 @@ UWORD32 ih264d_map_error(UWORD32 i4_err_status)
case ERROR_PROFILE_NOT_SUPPORTED:
case ERROR_INIT_NOT_DONE:
case IVD_MEM_ALLOC_FAILED:
+ case ERROR_FEATURE_UNAVAIL:
+ case IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED:
temp = 1 << IVD_FATALERROR;
H264_DEC_DEBUG_PRINT("\nFatal Error\n");
break;
@@ -1625,7 +1627,6 @@ UWORD32 ih264d_map_error(UWORD32 i4_err_status)
break;
case ERROR_NOT_SUPP_RESOLUTION:
- case ERROR_FEATURE_UNAVAIL:
case ERROR_ACTUAL_LEVEL_GREATER_THAN_INIT:
temp = 1 << IVD_UNSUPPORTEDINPUT;
break;
@@ -2260,6 +2261,8 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|| (ret == ERROR_UNAVAIL_PICBUF_T)
|| (ret == ERROR_UNAVAIL_MVBUF_T)
|| (ret == ERROR_INV_SPS_PPS_T)
+ || (ret == ERROR_FEATURE_UNAVAIL)
+ || (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED)
|| (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE))
{
ps_dec->u4_slice_start_code_found = 0;
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index a53d7c4..4325390 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -608,7 +608,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
/* Monochrome is not supported */
if(ps_seq->i4_chroma_format_idc != 1)
{
- return ERROR_INV_SPS_PPS_T;
+ return ERROR_FEATURE_UNAVAIL;
}
/* reading bit_depth_luma_minus8 */
@@ -617,7 +617,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
if(ps_seq->i4_bit_depth_luma_minus8 != 0)
{
- return ERROR_INV_SPS_PPS_T;
+ return ERROR_FEATURE_UNAVAIL;
}
/* reading bit_depth_chroma_minus8 */
@@ -626,7 +626,7 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
{
- return ERROR_INV_SPS_PPS_T;
+ return ERROR_FEATURE_UNAVAIL;
}
/* reading qpprime_y_zero_transform_bypass_flag */