Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV uses deprecated version of Protobuf's SetTotalBytesLimit() #20827

Closed
1 of 4 tasks
moubctez opened this issue Oct 6, 2021 · 1 comment
Closed
1 of 4 tasks

OpenCV uses deprecated version of Protobuf's SetTotalBytesLimit() #20827

moubctez opened this issue Oct 6, 2021 · 1 comment

Comments

@moubctez
Copy link

moubctez commented Oct 6, 2021

System information (version)
  • OpenCV => 3.4.15
  • Operating System / Platform => all
  • Compiler => Clang/GCC
Detailed description

OpenCV uses deprecated version of Protobuf's SetTotalBytesLimit().
See protocolbuffers/protobuf#8794
Patch to fix the issue:

--- modules/dnn/src/caffe/caffe_io.cpp.orig	2021-10-06 19:52:42.000000000 +0000
+++ modules/dnn/src/caffe/caffe_io.cpp
@@ -1111,7 +1111,7 @@ static const int kProtoReadBytesLimit = 
 
 bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) {
     CodedInputStream coded_input(input);
-    coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
+    coded_input.SetTotalBytesLimit(kProtoReadBytesLimit);
 
     return proto->ParseFromCodedStream(&coded_input);
 }
Steps to reproduce

Build OpenCV.

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc
@alalek
Copy link
Member

alalek commented Oct 6, 2021

Already fixed here: #20386

I updated to latest OpenCV version and the issue is still there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants