Fix OMX_IndexParamConsumerUsageBits size check

Bug: 27207275
Change-Id: I9a7c9fb22a0e84a490ff09c151bd2f88141fdbc0
(cherry picked from commit 788b0b651b5b14f27b0aee050ffd2a32629c7cd3)
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index 9be9b41..b082fe4 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -699,11 +699,12 @@
             void *params = NULL;
             size_t pageSize = 0;
             size_t allocSize = 0;
-            if ((index == (OMX_INDEXTYPE) OMX_IndexParamConsumerUsageBits && size < 4) ||
-                    (code != SET_INTERNAL_OPTION && size < 8)) {
+            bool isUsageBits = (index == (OMX_INDEXTYPE) OMX_IndexParamConsumerUsageBits);
+            if ((isUsageBits && size < 4) ||
+                    (!isUsageBits && code != SET_INTERNAL_OPTION && size < 8)) {
                 // we expect the structure to contain at least the size and
                 // version, 8 bytes total
-                ALOGE("b/27207275 (%zu)", size);
+                ALOGE("b/27207275 (%zu) (%d/%d)", size, int(index), int(code));
                 android_errorWriteLog(0x534e4554, "27207275");
             } else {
                 err = NO_MEMORY;