commit | d412d7b1d29fd4d9b13c256ec429c773c9c94727 | [log] [tgz] |
---|---|---|
author | Chia-I Wu <olv@google.com> | Tue Mar 07 14:44:04 2017 -0800 |
committer | Chia-I Wu <olv@google.com> | Tue Mar 07 14:45:33 2017 -0800 |
tree | 06d68d05c47be8deb502461ff81e78e2b4dad454 | |
parent | e86947e848fca46a00e347a785813c547d840cce [diff] |
graphics: initialize count to 0 in initCapabilities Be more defensive against HALs that do not initialize count. Test: manual Change-Id: I8b70454a1a3134c01d225be504579fc2e81ca88b
diff --git a/graphics/allocator/2.0/default/Gralloc.cpp b/graphics/allocator/2.0/default/Gralloc.cpp index 3a102d1..0b9e863 100644 --- a/graphics/allocator/2.0/default/Gralloc.cpp +++ b/graphics/allocator/2.0/default/Gralloc.cpp
@@ -131,7 +131,7 @@ void GrallocHal::initCapabilities() { - uint32_t count; + uint32_t count = 0; mDevice->getCapabilities(mDevice, &count, nullptr); std::vector<Capability> caps(count);
diff --git a/graphics/mapper/2.0/default/GrallocMapper.cpp b/graphics/mapper/2.0/default/GrallocMapper.cpp index 3b6460a..526aca2 100644 --- a/graphics/mapper/2.0/default/GrallocMapper.cpp +++ b/graphics/mapper/2.0/default/GrallocMapper.cpp
@@ -127,7 +127,7 @@ void GrallocMapperHal::initCapabilities() { - uint32_t count; + uint32_t count = 0; mDevice->getCapabilities(mDevice, &count, nullptr); std::vector<int32_t> caps(count);