From 754b12defd3408e65780b22a4ac1bbba94f6e704 Mon Sep 17 00:00:00 2001 From: Hamsalekha S Date: Fri, 10 Feb 2017 14:47:11 +0530 Subject: Decoder: Fix in the case of MMCO 6 Added an error check in the case of MMCO 6 (SET_LT_INDEX) Bug: 38014992 Test: POC fails before / works after patch Change-Id: I76e38a8e2ff0bab043b47f44f1f7b1d4fe60d416 (cherry picked from commit 9e4f0ce7042078aeffaa16f2773cc2d1b82cdb12) (cherry picked from commit 41489f9ece970df8530e28d7a24710b1beb755e2) --- decoder/ih264d_dpb_mgr.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'decoder/ih264d_dpb_mgr.c') diff --git a/decoder/ih264d_dpb_mgr.c b/decoder/ih264d_dpb_mgr.c index e02cc90..0a61ffd 100644 --- a/decoder/ih264d_dpb_mgr.c +++ b/decoder/ih264d_dpb_mgr.c @@ -1289,11 +1289,22 @@ WORD32 ih264d_do_mmco_buffer(dpb_commands_t *ps_dpb_cmds, u4_cur_pic_num); if(ret != OK) return ret; - ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr, - u4_cur_pic_num, u4_lt_idx, - u1_fld_pic_flag); - if(ret != OK) - return ret; + + if(ps_dpb_mgr->u1_num_st_ref_bufs > 0) + + { + ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr, + u4_cur_pic_num, + u4_lt_idx, + u1_fld_pic_flag); + if(ret != OK) + return ret; + } + else + { + return ERROR_DBP_MANAGER_T; + } + u1_marked_lt = 1; break; } -- cgit v1.2.3