From 6efa51e6044d6f7366ecd567b4994262bf865e02 Mon Sep 17 00:00:00 2001 From: wanghongen Date: Thu, 7 Aug 2025 17:51:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?camera=20interface=E4=BB=93=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanghongen --- camera/metadata/src/metadata_utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index d71a4318..11a614e2 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -413,7 +413,10 @@ std::string MetadataUtils::EncodeToString(std::shared_ptr metada METADATA_ERR_LOG("MetadataUtils::EncodeToString Metadata is invalid"); return {}; } - + if (encodeDataLen < headerLength) { + METADATA_ERR_LOG("encodeDataLen < headerLength"); + return {}; + } common_metadata_header_t *meta = metadata->get(); int32_t encodeDataLen = headerLength + (itemLen * meta->item_count) + meta->data_count; std::string s(encodeDataLen, '\0'); -- Gitee From c71e07a1fe7513515efc0f7d7ae074fdc7283401 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 7 Aug 2025 10:56:24 +0000 Subject: [PATCH 2/2] update camera/metadata/src/metadata_utils.cpp. Signed-off-by: wanghongenaf --- camera/metadata/src/metadata_utils.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/camera/metadata/src/metadata_utils.cpp b/camera/metadata/src/metadata_utils.cpp index 11a614e2..fa27c5ab 100644 --- a/camera/metadata/src/metadata_utils.cpp +++ b/camera/metadata/src/metadata_utils.cpp @@ -414,7 +414,6 @@ std::string MetadataUtils::EncodeToString(std::shared_ptr metada return {}; } if (encodeDataLen < headerLength) { - METADATA_ERR_LOG("encodeDataLen < headerLength"); return {}; } common_metadata_header_t *meta = metadata->get(); -- Gitee