Merge pull request #14890 from alalek:dnn_consistent_protobuf_readers

pull/14900/head
Alexander Alekhin 6 years ago
commit 2172544bb7
  1. 7
      modules/dnn/src/caffe/caffe_io.cpp

@ -1137,7 +1137,12 @@ bool ReadProtoFromBinaryFile(const char* filename, Message* proto) {
bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) {
ArrayInputStream input(data, len);
return google::protobuf::TextFormat::Parse(&input, proto);
#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF
return google::protobuf::TextFormat::Parser(true).Parse(&input, proto);
#else
return google::protobuf::TextFormat::Parser().Parse(&input, proto);
#endif
}

Loading…
Cancel
Save