diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-03-03 15:06:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-03 15:06:34 +0100 |
commit | cbb4fe45d039ad16abe992d2212011c260d6ac17 (patch) | |
tree | 0fede6f8b5e0e6300c1f03de1aeb3ddb6a9ef5e1 /thirdparty | |
parent | 973d4753a287306706dc2535958771074941bb7e (diff) | |
parent | 7c0da76402a6b53237ecec34757f686d2fac642b (diff) |
Merge pull request #17035 from Chaosus/fixleaks
Fix memory leaks
Diffstat (limited to 'thirdparty')
-rw-r--r-- | thirdparty/README.md | 9 | ||||
-rw-r--r-- | thirdparty/b2d_convexdecomp/b2Polygon.cpp | 7 | ||||
-rw-r--r-- | thirdparty/etc2comp/EtcFilter.cpp | 3 | ||||
-rw-r--r-- | thirdparty/libsimplewebm/libwebm/mkvparser/mkvparser.cc | 4 |
4 files changed, 21 insertions, 2 deletions
diff --git a/thirdparty/README.md b/thirdparty/README.md index f7b27dd0e6..d3fa0e4664 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -11,6 +11,9 @@ The files were adapted to Godot by removing the dependency on b2Math (replacing it by b2Glue.h) and commenting out some verbose printf calls. Upstream code has not changed in 10 years, no need to keep track of changes. +Important: Some files have Godot-made changes. +They are marked with `// -- GODOT start --` and `// -- GODOT end --` +comments. ## bullet @@ -69,6 +72,9 @@ Files extracted from upstream source: - all .cpp and .h files in EtcLib/ - README.md, LICENSE, AUTHORS +Important: Some files have Godot-made changes. +They are marked with `// -- GODOT start --` and `// -- GODOT end --` +comments. ## fonts @@ -165,6 +171,9 @@ Files extracted from upstream source: TODO. +Important: Some files have Godot-made changes. +They are marked with `// -- GODOT start --` and `// -- GODOT end --` +comments. ## libtheora diff --git a/thirdparty/b2d_convexdecomp/b2Polygon.cpp b/thirdparty/b2d_convexdecomp/b2Polygon.cpp index b6ead62c63..c80204ae21 100644 --- a/thirdparty/b2d_convexdecomp/b2Polygon.cpp +++ b/thirdparty/b2d_convexdecomp/b2Polygon.cpp @@ -1342,7 +1342,12 @@ b2Polygon TraceEdge(b2Polygon* p){ if (nodes[j].nConnected == 0) continue; b2Vec2 diff = nodes[i].position - nodes[j].position; if (diff.LengthSquared() <= COLLAPSE_DIST_SQR){ - if (nActive <= 3) return b2Polygon(); + if (nActive <= 3) { + // -- GODOT start -- + delete[] nodes; + // -- GODOT end -- + return b2Polygon(); + } //printf("Found dupe, %d left\n",nActive); --nActive; foundDupe = true; diff --git a/thirdparty/etc2comp/EtcFilter.cpp b/thirdparty/etc2comp/EtcFilter.cpp index bc899a533e..1ec8acdf3f 100644 --- a/thirdparty/etc2comp/EtcFilter.cpp +++ b/thirdparty/etc2comp/EtcFilter.cpp @@ -228,6 +228,9 @@ int FilterTwoPass( RGBCOLOR *pSrcImage, int srcWidth, int srcHeight, pTempImage = (RGBCOLOR *)malloc( destWidth * srcHeight * sizeof(RGBCOLOR) ); if ( pTempImage == NULL ) { + // -- GODOT start -- + free( contrib ); + // -- GODOT end -- return 0; } diff --git a/thirdparty/libsimplewebm/libwebm/mkvparser/mkvparser.cc b/thirdparty/libsimplewebm/libwebm/mkvparser/mkvparser.cc index bda67a5758..d2375edb3b 100644 --- a/thirdparty/libsimplewebm/libwebm/mkvparser/mkvparser.cc +++ b/thirdparty/libsimplewebm/libwebm/mkvparser/mkvparser.cc @@ -1284,7 +1284,9 @@ long Segment::DoLoadCluster(long long& pos, long& len) { pos += cluster_size; m_pos = pos; - + // -- GODOT start -- + delete pCluster; + // -- GODOT end -- if (segment_stop > 0 && m_pos > segment_stop) return E_FILE_FORMAT_INVALID; |