summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2023-08-31 16:16:55 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-08-31 16:16:55 +0000
commit5267067c4ad93cd9bd24dec69f09d7ce426cc0c5 (patch)
treef9e155892e9acb7b7ae07ab099ff0fd950a7728f
parent719b9e06f733ab384ae8dbd89ebbd5f5f3e18b8c (diff)
parent12b989df0ccaf2de28e9187e2d783849aee05309 (diff)
downloadgchips-5267067c4ad93cd9bd24dec69f09d7ce426cc0c5.tar.gz
gralloc4: Fix overflow when using large width with BLOB format am: 12b989df0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/24607843 Change-Id: I8df87568923e9f42448c4838df2420600ee08226 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
index 4a0618b..27faa51 100644
--- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
+++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
@@ -578,7 +578,7 @@ static void calc_allocation_size(const int width,
else
{
assert((plane_info[plane].alloc_width * format.bpp[plane]) % 8 == 0);
- plane_info[plane].byte_stride = (plane_info[plane].alloc_width * format.bpp[plane]) / 8;
+ plane_info[plane].byte_stride = (static_cast<uint64_t>(plane_info[plane].alloc_width) * format.bpp[plane]) / 8;
/*
* Align byte stride (uncompressed allocations only).