summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRainer Schuetze <r.sagitario@gmx.de>2018-12-12 07:16:08 (GMT)
committerRainer Schuetze <r.sagitario@gmx.de>2018-12-12 07:16:08 (GMT)
commit6af8029154cd76b998d3be2fe59c461295eef0e9 (patch)
treea52f50ef07566dfe95a4951ebd9468f067d68ac0 /src
parent58dab3c4102e99a9444dcf5e445f2e3fd9cdb5ec (diff)
downloadcv2pdb-6af8029154cd76b998d3be2fe59c461295eef0e9.zip
cv2pdb-6af8029154cd76b998d3be2fe59c461295eef0e9.tar.gz
cv2pdb-6af8029154cd76b998d3be2fe59c461295eef0e9.tar.bz2
fix #41: cv2pdb crashes if mspdb*.dll cannot be loaded from path
Diffstat (limited to 'src')
-rw-r--r--src/mspdb.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mspdb.cpp b/src/mspdb.cpp
index 2e968f8..00684ed 100644
--- a/src/mspdb.cpp
+++ b/src/mspdb.cpp
@@ -96,7 +96,9 @@ bool tryLoadMsPdbCom(const char* mspdb, const char* path = 0)
unsigned long fetched;
auto result = query.CreateInstance(__uuidof(SetupConfiguration));
- if ((FAILED(result) && result != REGDB_E_CLASSNOTREG) || FAILED(query->EnumInstances(&instances)))
+ if (FAILED(result) || !query)
+ return false;
+ if (FAILED(query->EnumInstances(&instances)))
return false;
while (!modMsPdb)