From 47533ebe03eab109734d95678e2c42442ae5b061 Mon Sep 17 00:00:00 2001 From: Tommy Bojanin Date: Thu, 15 Jul 2021 17:34:36 -0700 Subject: [PATCH 1/2] Fix resource leak caused by open file in DepthMap.cc --- libs/MVS/DepthMap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/MVS/DepthMap.cpp b/libs/MVS/DepthMap.cpp index d90634fb9..906ac9e82 100644 --- a/libs/MVS/DepthMap.cpp +++ b/libs/MVS/DepthMap.cpp @@ -1844,6 +1844,7 @@ bool MVS::ImportDepthDataRaw(const String& fileName, String& imageFileName, header.imageWidth < header.depthWidth || header.imageHeight < header.depthHeight) { DEBUG("error: invalid depth-data file '%s'", fileName.c_str()); + fclose(f); return false; } From 2b068de01e396f48d0e1c3ff7fd6d1742c6e5e86 Mon Sep 17 00:00:00 2001 From: cDc Date: Fri, 16 Jul 2021 07:34:43 +0300 Subject: [PATCH 2/2] Update DepthMap.cpp --- libs/MVS/DepthMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/MVS/DepthMap.cpp b/libs/MVS/DepthMap.cpp index 906ac9e82..06f3d0144 100644 --- a/libs/MVS/DepthMap.cpp +++ b/libs/MVS/DepthMap.cpp @@ -1844,7 +1844,7 @@ bool MVS::ImportDepthDataRaw(const String& fileName, String& imageFileName, header.imageWidth < header.depthWidth || header.imageHeight < header.depthHeight) { DEBUG("error: invalid depth-data file '%s'", fileName.c_str()); - fclose(f); + fclose(f); return false; }