Ensure ih264d_start_of_pic() is not repeated in ih264d_mark_err_slice_skip()

In case of error in handling MMCO commpands/reference list creation,
ih264d_start_of_pic() was called again in ih264d_mark_err_slice_skip() resulting in
leaking a picture or an MV buffer in buffer manager.

To fix this, ensure prev_slice_err is set to 1 only if u4_pic_buf_got is zero, before
calling ih264d_mark_err_slice_skip() at the end of picture decode.
This will ensure ih264d_start_of_pic() is not repeated

Bug: 25818142

Change-Id: I7d5a9179533581eec663bc6a19a2901e7cce6af3
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index cd91483..c264d9a 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -2085,7 +2085,7 @@
         num_mb_skipped = (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
                             - ps_dec->u2_total_mbs_coded;
 
-        if(ps_dec->u4_first_slice_in_pic)
+        if(ps_dec->u4_first_slice_in_pic && (ps_dec->u4_pic_buf_got == 0))
             prev_slice_err = 1;
         else
             prev_slice_err = 2;
@@ -2112,8 +2112,11 @@
         {
             ih264d_signal_bs_deblk_thread(ps_dec);
         }
-        /* dont consume bitstream */
-        ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
+        /* dont consume bitstream for change in resolution case */
+        if(ret == IVD_RES_CHANGED)
+        {
+            ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
+        }
         return IV_FAIL;
     }