aboutsummaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-05-01 22:15:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-01 22:15:00 +0000
commit4f46e4b626a45b8763c43140857e973a485eac78 (patch)
treec9c032a655b10279596b2c9a0f21db0f26ab030d /decoder
parent8925a5b7fb2c048a53c3888ebaf3027cc0295d68 (diff)
parent7461e43ed8a241f47399c2f5fcc6de74e6fd9918 (diff)
downloadlibhevc-4f46e4b626a45b8763c43140857e973a485eac78.tar.gz
Merge "decoder: Report unsupported bitdepth and color format as fatal errors" into qt-dev
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ihevcd_api.c2
-rw-r--r--decoder/ihevcd_cxa.h1
-rw-r--r--decoder/ihevcd_decode.c8
3 files changed, 7 insertions, 4 deletions
diff --git a/decoder/ihevcd_api.c b/decoder/ihevcd_api.c
index dcd3c44..134ed31 100644
--- a/decoder/ihevcd_api.c
+++ b/decoder/ihevcd_api.c
@@ -2125,7 +2125,7 @@ WORD32 ihevcd_create(iv_obj_t *ps_codec_obj,
}
}
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;
}
diff --git a/decoder/ihevcd_cxa.h b/decoder/ihevcd_cxa.h
index bcc0cfe..f81a7eb 100644
--- a/decoder/ihevcd_cxa.h
+++ b/decoder/ihevcd_cxa.h
@@ -45,6 +45,7 @@ extern "C" {
/*****************************************************************************/
/* Constant Macros */
/*****************************************************************************/
+#define IVD_ERROR_MASK 0xFF
/*****************************************************************************/
/* Function Macros */
diff --git a/decoder/ihevcd_decode.c b/decoder/ihevcd_decode.c
index e067388..1295687 100644
--- a/decoder/ihevcd_decode.c
+++ b/decoder/ihevcd_decode.c
@@ -137,6 +137,10 @@ static UWORD32 ihevcd_map_error(IHEVCD_ERROR_T e_error)
case IHEVCD_NUM_EXTRA_DISP_UNSUPPORTED:
case IHEVCD_INSUFFICIENT_MEM_MVBANK:
case IHEVCD_INSUFFICIENT_MEM_PICBUF:
+ case IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC:
+ case IHEVCD_UNSUPPORTED_BIT_DEPTH:
+ case IVD_MEM_ALLOC_FAILED:
+ case IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED:
error_code |= 1 << IVD_FATALERROR;
break;
case IHEVCD_INVALID_DISP_STRD:
@@ -144,8 +148,6 @@ static UWORD32 ihevcd_map_error(IHEVCD_ERROR_T e_error)
case IHEVCD_UNSUPPORTED_VPS_ID:
case IHEVCD_UNSUPPORTED_SPS_ID:
case IHEVCD_UNSUPPORTED_PPS_ID:
- case IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC:
- case IHEVCD_UNSUPPORTED_BIT_DEPTH:
case IHEVCD_BUF_MGR_ERROR:
case IHEVCD_NO_FREE_MVBANK:
case IHEVCD_NO_FREE_PICBUF:
@@ -717,7 +719,7 @@ WORD32 ihevcd_decode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
/* Free any dynamic buffers that are allocated */
ihevcd_free_dynamic_bufs(ps_codec);
ps_codec->i4_error_code = IVD_MEM_ALLOC_FAILED;
- ps_dec_op->u4_error_code |= 1 << IVD_FATALERROR;
+ ps_dec_op->u4_error_code = 1 << IVD_FATALERROR;
ps_dec_op->u4_error_code |= IVD_MEM_ALLOC_FAILED;
return IV_FAIL;