gralloc: Fix integer overflow in roundUpToPageSize

- Changed the input and return value from integer to size_t in
  roundUpToPageSize

Change-Id: I526b90d3d85cd263b1a4dd524bd3e759ff0fd491
This commit is contained in:
Rosa Chen
2022-11-22 15:35:34 -05:00
parent 8b8cd1a8dc
commit 2a4c372675

View File

@@ -73,7 +73,7 @@
#define USE_SYSTEM_HEAP_FOR_SENSORS GRALLOC_PROP("use_system_heap_for_sensors")
#define ROUND_UP_PAGESIZE(x) roundUpToPageSize(x)
inline int roundUpToPageSize(int x) {
inline size_t roundUpToPageSize(size_t x) {
return (x + (getpagesize() - 1)) & ~(getpagesize() - 1);
}