mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Merge pull request #24316 from alexlyulkov:al/fix-caffe-read-segfault
Fixed segfault when reading Caffe model
This commit is contained in:
commit
9942757bab
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user