Commit f1d16f43 authored by Ricky Liang's avatar Ricky Liang Committed by Chromium LUCI CQ

video_capture: chromeos: check for metadata with invalid data

In case a metadata is returned with valid tag but no data, count the
metadata entry as invalid.

Bug: 1155255
Test: compile and manually verify that camera works on DUT
Change-Id: I663ba5cdab177d95c83a77546c70ffd9122157f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2620741
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Reviewed-by: default avatarWei Lee <wtlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841938}
parent 7d27055f
...@@ -56,7 +56,15 @@ cros::mojom::CameraMetadataEntryPtr* GetMetadataEntry( ...@@ -56,7 +56,15 @@ cros::mojom::CameraMetadataEntryPtr* GetMetadataEntry(
if (iter == camera_metadata->entries.value().end()) { if (iter == camera_metadata->entries.value().end()) {
return nullptr; return nullptr;
} }
return &(camera_metadata->entries.value()[(*iter)->index]);
auto* entry_ptr = &(camera_metadata->entries.value()[(*iter)->index]);
if (!(*entry_ptr)->data.data()) {
// Metadata tag found with no valid data.
LOG(WARNING) << "Found tag " << static_cast<int>(tag)
<< " but with invalid data";
return nullptr;
}
return entry_ptr;
} }
void AddOrUpdateMetadataEntry(cros::mojom::CameraMetadataPtr* to, void AddOrUpdateMetadataEntry(cros::mojom::CameraMetadataPtr* to,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment