cameraserver hidl: Skip vendor ids with tag count <=0 for getCameraVendorTagSections.
Bug: 199420805
Test: Use getCameraVendorTagSections on devices where a provider returns -1 for getTagCount via vndk
Change-Id: I29f23b6771168ec19c693b2a443f1c9a3fe4c13d
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
diff --git a/services/camera/libcameraservice/hidl/HidlCameraService.cpp b/services/camera/libcameraservice/hidl/HidlCameraService.cpp
index 7d1b3cf..a812587 100644
--- a/services/camera/libcameraservice/hidl/HidlCameraService.cpp
+++ b/services/camera/libcameraservice/hidl/HidlCameraService.cpp
@@ -279,6 +279,9 @@
size_t numSections = sectionNames->size();
std::vector<std::vector<HVendorTag>> tagsBySection(numSections);
int tagCount = desc->getTagCount();
+ if (tagCount <= 0) {
+ continue;
+ }
std::vector<uint32_t> tags(tagCount);
desc->getTagArray(tags.data());
for (int i = 0; i < tagCount; i++) {