summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorGaurav Batra <gbatra@nvidia.com>2014-10-31 16:13:38 -0700
committerRuben Brunk <rubenbrunk@google.com>2014-11-03 18:57:50 +0000
commit0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd (patch)
tree3738e599a1c8e87d362ed31cc639df3f9f8592a5 /camera
parent151b3f41ffcdf187580542ba0c0d3b84df16beed (diff)
downloadframeworks_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.cpp2
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*>(&sectionCount))) != OK) {
ALOGE("%s: could not read section count for.", __FUNCTION__);