Fix typo in return value
VENDOR_TAG_NAME_ERR, which is NULL, was being returend by a function
that returns int. When NULL is defined as 0 that compiles, but the
C++ spec also allows NULL to be std::nullptr, which cannot be implicitly
cast to int. Use VENDOR_TAG_TYPE_ERR instead.
Fixes compiling against musl libc, which uses std::nullptr for NULL.
Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ib14a2ada791ef59dc37e0a0d1d9e401ce86d7d6f
diff --git a/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp
index 24fa912..b37803a 100644
--- a/camera/VendorTagDescriptor.cpp
+++ b/camera/VendorTagDescriptor.cpp
@@ -760,7 +760,7 @@
Mutex::Autolock al(sLock);
if (sGlobalVendorTagDescriptorCache == NULL) {
ALOGE("%s: Vendor tag descriptor cache not initialized.", __FUNCTION__);
- return VENDOR_TAG_NAME_ERR;
+ return VENDOR_TAG_TYPE_ERR;
}
return sGlobalVendorTagDescriptorCache->getTagType(tag, id);
}