Make PASSTHROUGH_USAGE_MASK real 64bit mask
Since GRALLOC_USAGE_SW_READ_MASK, GRALLOC_USAGE_SW_WRITE_MASK,
and GRALLOC_USAGE_PROTECTED are not uint64_t. Without casting,
PASSTHROUGH_USAGE_MASK is actually a 32bit mask.
Bug: 182361811
Change-Id: I01c1284f4696840b86f6de875243e69ab6dc324c
diff --git a/media/codec2/vndk/C2AllocatorGralloc.cpp b/media/codec2/vndk/C2AllocatorGralloc.cpp
index bee6b7f..4ffa3f1 100644
--- a/media/codec2/vndk/C2AllocatorGralloc.cpp
+++ b/media/codec2/vndk/C2AllocatorGralloc.cpp
@@ -42,7 +42,9 @@
* Usage mask that is passed through from gralloc to Codec 2.0 usage.
*/
PASSTHROUGH_USAGE_MASK =
- ~(GRALLOC_USAGE_SW_READ_MASK | GRALLOC_USAGE_SW_WRITE_MASK | GRALLOC_USAGE_PROTECTED)
+ ~static_cast<uint64_t>(GRALLOC_USAGE_SW_READ_MASK |
+ GRALLOC_USAGE_SW_WRITE_MASK |
+ GRALLOC_USAGE_PROTECTED)
};
// verify that passthrough mask is within the platform mask