1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Fixed segfault when reading Caffe model

This commit is contained in:
Alexander Lyulkov
2023-09-25 12:55:11 +07:00
parent 157b0e7760
commit 72e7672a6c
+1
View File
@@ -125,6 +125,7 @@ public:
{
const google::protobuf::UnknownField& field = unknownFields.field(i);
CV_Assert(field.type() == google::protobuf::UnknownField::TYPE_GROUP);
CV_CheckGE(field.group().field_count(), 2, "UnknownField should have at least 2 items: name and value");
std::string fieldName = field.group().field(0).length_delimited();
std::string fieldValue = field.group().field(1).length_delimited();
params.set(fieldName, fieldValue);