diff options
author | Gaurav Batra <gbatra@nvidia.com> | 2014-10-31 16:13:38 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2014-11-03 18:57:50 +0000 |
commit | 0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd (patch) | |
tree | 3738e599a1c8e87d362ed31cc639df3f9f8592a5 /camera | |
parent | 151b3f41ffcdf187580542ba0c0d3b84df16beed (diff) | |
download | frameworks_av-0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd.zip frameworks_av-0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd.tar.gz frameworks_av-0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd.tar.bz2 |
camera: fix vendortags section malloc failure
size_t type variables should be initialized properly especially on 64-bit archs
if they are type casted to shorter datatypes for some operation and then later
used in entirety. The results may be unpredictable since the most significant
bytes may contain garbage.
Bug 18222311
Change-Id: Iced82e964cf8c98f6856d257fc1534a5237a9064
Diffstat (limited to 'camera')
-rw-r--r-- | camera/VendorTagDescriptor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp index 0dda6b6..dce313a 100644 --- a/camera/VendorTagDescriptor.cpp +++ b/camera/VendorTagDescriptor.cpp @@ -206,7 +206,7 @@ status_t VendorTagDescriptor::createFromParcel(const Parcel* parcel, return res; } - size_t sectionCount; + size_t sectionCount = 0; if (tagCount > 0) { if ((res = parcel->readInt32(reinterpret_cast<int32_t*>(§ionCount))) != OK) { ALOGE("%s: could not read section count for.", __FUNCTION__); |