Commit 2e11a25f authored by Hanlin Chen's avatar Hanlin Chen Committed by Chromium LUCI CQ

VCD: Fix entry_count when discarding duplicated entry tag

When merging metadata of partial results, VCD will discard duplicated
tags. This cause the entry_count being larger then actual entry array.

Bug: 177992869
Change-Id: Icd176dc41a5a8ad15f3bbe93ad874679e8d4ecc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639342Reviewed-by: default avatarJasmine Chen <lnishan@google.com>
Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Hanlin Chen <hanlinchen@google.com>
Cr-Commit-Position: refs/heads/master@{#845566}
parent a040d515
...@@ -127,6 +127,7 @@ void MergeMetadata(cros::mojom::CameraMetadataPtr* to, ...@@ -127,6 +127,7 @@ void MergeMetadata(cros::mojom::CameraMetadataPtr* to,
} }
for (const auto& entry : from->entries.value()) { for (const auto& entry : from->entries.value()) {
if (tags.find(entry->tag) != tags.end()) { if (tags.find(entry->tag) != tags.end()) {
(*to)->entry_count -= 1;
LOG(ERROR) << "Found duplicated entries for tag " << entry->tag; LOG(ERROR) << "Found duplicated entries for tag " << entry->tag;
continue; continue;
} }
......
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