mpeg4enc: fix OOB in RasterIntraUpdate

Change the order of checks to avoid OOB read in intraArray

Bug: 176084648
Test: poc in bug
Change-Id: Id6cf902cb7b386760d5f641f05e99ece91621ec5
Merged-In: Id6cf902cb7b386760d5f641f05e99ece91621ec5
diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp
index 997b78d..9deb023 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp
@@ -1576,7 +1576,7 @@
 
     /* find the last refresh MB */
     indx = 0;
-    while (intraArray[indx] == 1 && indx < totalMB)
+    while (indx < totalMB && intraArray[indx] == 1)
         indx++;
 
     /* add more  */