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.

Bug: 35584425
Test: ran POC - no hang, no segfault.

Change-Id: I94e3857944da675eda38f8e1a9bd887f48bff524
diff --git a/decoder/ih264d_dpb_mgr.c b/decoder/ih264d_dpb_mgr.c
index 6261986..453dcab 100644
--- a/decoder/ih264d_dpb_mgr.c
+++ b/decoder/ih264d_dpb_mgr.c
@@ -292,6 +292,8 @@
             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
@@ -338,7 +340,7 @@
         /* 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++;
 
     }