Skip to content

Commit

Permalink
[OpenCV3] fix build with latest protobuf (#20301)
Browse files Browse the repository at this point in the history
* [OpenCV3] fix compatibility with latest protobuf

* [OpenCV3] fix references
  • Loading branch information
cenit authored Sep 24, 2021
1 parent 6f9e896 commit 6a398a2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
11 changes: 11 additions & 0 deletions ports/opencv3/0011-fix-caffe-io.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/modules/dnn/src/caffe/caffe_io.cpp
+++ b/modules/dnn/src/caffe/caffe_io.cpp
@@ -1111,7 +1111,7 @@ static const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 by

bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) {
CodedInputStream coded_input(input);
- coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
+ coded_input.SetTotalBytesLimit(kProtoReadBytesLimit);

return proto->ParseFromCodedStream(&coded_input);
}
1 change: 1 addition & 0 deletions ports/opencv3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ vcpkg_from_github(
0008-devendor-quirc.patch
0009-fix-protobuf.patch
0010-fix-uwp-tiff-imgcodecs.patch
0011-fix-caffe-io.patch
)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
Expand Down
2 changes: 1 addition & 1 deletion ports/opencv3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencv3",
"version": "3.4.15",
"port-version": 1,
"port-version": 2,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4778,7 +4778,7 @@
},
"opencv3": {
"baseline": "3.4.15",
"port-version": 1
"port-version": 2
},
"opencv4": {
"baseline": "4.5.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opencv3.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "27a6a94907d72955e9d473dfbce89ae851ee1bda",
"version": "3.4.15",
"port-version": 2
},
{
"git-tree": "47b6ae97aeb00ba20b231fdbb2fa043cdc5de2c5",
"version": "3.4.15",
Expand Down

0 comments on commit 6a398a2

Please sign in to comment.