summaryrefslogtreecommitdiffstats
path: root/decoder
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2015-09-02 09:01:40 +0530
committerRachad Alao <rachad@google.com>2015-09-25 22:24:55 +0000
commit59348127deae4c5cedf56e1c3f8c7f382c5acaba (patch)
tree5c2e9d243bbfdd545916946a4d4f228434c2beec /decoder
parent07ae78bd274d4e042be340239de71ed046b16023 (diff)
downloadandroid_external_libavc-59348127deae4c5cedf56e1c3f8c7f382c5acaba.tar.gz
android_external_libavc-59348127deae4c5cedf56e1c3f8c7f382c5acaba.tar.bz2
android_external_libavc-59348127deae4c5cedf56e1c3f8c7f382c5acaba.zip
Decoder: Fixed an issue in handling flush
Fixed a NULL pointer reference, when flush is called before decoding any pictures. This was seen in following CTS test, android.media.cts.DecoderTest#testCodecResetsH264WithSurface Fixed code formatting issues in ih264d_set_flush_mode Updated the testbench to call flush before decoding starts Bug: 24405410 Change-Id: Ib04e0b15573b2482c9d5b43c8bc7dd30d8f8efdd
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ih264d_api.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 6ef5185..5442dae 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -2484,7 +2484,6 @@ WORD32 ih264d_set_display_frame(iv_obj_t *dec_hdl,
/*****************************************************************************/
WORD32 ih264d_set_flush_mode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
{
-
dec_struct_t * ps_dec;
ivd_ctl_flush_op_t *ps_ctl_op = (ivd_ctl_flush_op_t*)pv_api_op;
ps_ctl_op->u4_error_code = 0;
@@ -2495,19 +2494,15 @@ WORD32 ih264d_set_flush_mode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op
/* Signal flush frame control call */
ps_dec->u1_flushfrm = 1;
- if( ps_dec->u1_init_dec_flag == 1)
+ if(ps_dec->u1_init_dec_flag == 1)
{
-
- ih264d_release_pics_in_dpb((void *)ps_dec,
- ps_dec->u1_pic_bufs);
- ih264d_release_display_bufs(ps_dec);
+ ih264d_release_pics_in_dpb((void *)ps_dec, ps_dec->u1_pic_bufs);
+ ih264d_release_display_bufs(ps_dec);
}
- ps_ctl_op->u4_error_code =
- ((ivd_ctl_flush_op_t*)ps_dec->pv_dec_out)->u4_error_code; //verify the value
+ ps_ctl_op->u4_error_code = 0;
return IV_SUCCESS;
-
}
/*****************************************************************************/