From 46e96d40dbca2896b5e20cf48d14798231c97663 Mon Sep 17 00:00:00 2001 From: Hamsalekha S Date: Tue, 21 Feb 2017 15:47:02 +0530 Subject: [PATCH] Fix in the case of MMCO 3 (long term reference idx). Increment number of long term reference buffers only when both top field and bottom field have been set as long term. [backport for M/N from master] Bug: 35584425 Test: ran POC - no hang, no segfault. Change-Id: I94e3857944da675eda38f8e1a9bd887f48bff524 (cherry picked from commit 6fa5df8811ea0b8e8459f86dd3c30bf7a9b39482) --- decoder/ih264d_dpb_mgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/decoder/ih264d_dpb_mgr.c b/decoder/ih264d_dpb_mgr.c index a75aeee..e02cc90 100644 --- a/decoder/ih264d_dpb_mgr.c +++ b/decoder/ih264d_dpb_mgr.c @@ -291,6 +291,8 @@ WORD32 ih264d_insert_lt_node(dpb_manager_t *ps_dpb_mgr, ps_mov_node->s_bot_field.u1_reference_info = IS_LONG_TERM; ps_mov_node->s_top_field.u1_long_term_frame_idx = u4_lt_idx; ps_mov_node->s_bot_field.u1_long_term_frame_idx = u4_lt_idx; + u1_mark_bot_field_long_term = 1; + u1_mark_top_field_long_term = 1; } ps_mov_node->u1_lt_idx = u4_lt_idx; //Assign the LT index to the node @@ -337,7 +339,7 @@ WORD32 ih264d_insert_lt_node(dpb_manager_t *ps_dpb_mgr, /* Increment LT buf count only if new LT node inserted */ /* If Increment during top_field is done, don't increment */ /* for bottom field, as both them are part of same pic. */ - if(!u1_mark_bot_field_long_term) + if(u1_mark_bot_field_long_term) ps_dpb_mgr->u1_num_lt_ref_bufs++; }