Decoder: Fix end of bitstream error.

The end of bistream error check was fixed for
odd number of macroblocks in Mbaff frames.

Bug: 37008096
Test: Ittiam-verified
Change-Id: I058d74a3c1d1511968c2b36802dfc5c102947919
(cherry picked from commit 2e01924cd692191c970c64ec3f358e53dccb9e54)
diff --git a/decoder/ih264d_parse_islice.c b/decoder/ih264d_parse_islice.c
index 0312060..504b775 100644
--- a/decoder/ih264d_parse_islice.c
+++ b/decoder/ih264d_parse_islice.c
@@ -866,6 +866,8 @@
             ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
         }
 
+        uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
+
         if(u1_mbaff)
         {
             ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
@@ -879,7 +881,7 @@
         /**************************************************************/
 
         i2_cur_mb_addr++;
-        uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
+
 
         /* Store the colocated information */
         {
@@ -1087,8 +1089,7 @@
             {
                 ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
             }
-            /* Next macroblock information */
-            i2_cur_mb_addr++;
+
 
             if(ps_cur_mb_info->u1_topmb && u1_mbaff)
                 uc_more_data_flag = 1;
@@ -1099,6 +1100,16 @@
                 uc_more_data_flag = !uc_more_data_flag;
                 COPYTHECONTEXT("Decode Sliceterm",!uc_more_data_flag);
             }
+
+            if(u1_mbaff)
+            {
+                if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
+                {
+                    return ERROR_EOB_FLUSHBITS_T;
+                }
+            }
+            /* Next macroblock information */
+            i2_cur_mb_addr++;
             /* Store the colocated information */
             {
 
diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c
index a78ea97..97ea27c 100644
--- a/decoder/ih264d_parse_pslice.c
+++ b/decoder/ih264d_parse_pslice.c
@@ -1006,8 +1006,7 @@
         {
             ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
         }
-        /* Next macroblock information */
-        i2_cur_mb_addr++;
+
 
         if(ps_cur_mb_info->u1_topmb && u1_mbaff)
             uc_more_data_flag = 1;
@@ -1019,6 +1018,15 @@
             COPYTHECONTEXT("Decode Sliceterm",!uc_more_data_flag);
         }
 
+        if(u1_mbaff)
+        {
+            if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
+            {
+                return ERROR_EOB_FLUSHBITS_T;
+            }
+        }
+        /* Next macroblock information */
+        i2_cur_mb_addr++;
         u1_num_mbs++;
         u1_num_mbsNby2++;
         ps_parse_mb_data++;