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)
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 @@
                                           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;
                 }