try to actually fix null pointer deref
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -142,10 +142,10 @@ TiffComponent* TiffMnCreator::create(uint16_t tag, IfdId group, const std::strin
|
||||
TiffComponent* TiffMnCreator::create(uint16_t tag, IfdId group, IfdId mnGroup) {
|
||||
auto tmr = std::find(std::begin(registry_), std::end(registry_), mnGroup);
|
||||
if (tmr != std::end(registry_)) {
|
||||
if (!tmr->newMnFct2_) {
|
||||
std::cout << "mnGroup = " << mnGroup << "\n";
|
||||
if (tmr->newMnFct2_) {
|
||||
return tmr->newMnFct2_(tag, group, mnGroup);
|
||||
}
|
||||
return tmr->newMnFct2_(tag, group, mnGroup);
|
||||
std::cout << "mnGroup = " << mnGroup << "\n";
|
||||
}
|
||||
return nullptr;
|
||||
} // TiffMnCreator::create
|
||||
|
||||
+2
-2
@@ -123,10 +123,10 @@ static std::vector<std::string> getLoadedLibraries() {
|
||||
// enumerate loaded libraries and determine path to executable
|
||||
HMODULE handles[200];
|
||||
DWORD cbNeeded;
|
||||
if (EnumProcessModules(GetCurrentProcess(), handles, std::size(handles), &cbNeeded)) {
|
||||
if (EnumProcessModules(GetCurrentProcess(), handles, DWORD(std::size(handles)), &cbNeeded)) {
|
||||
char szFilename[_MAX_PATH];
|
||||
for (DWORD h = 0; h < cbNeeded / sizeof(handles[0]); h++) {
|
||||
GetModuleFileNameA(handles[h], szFilename, std::size(szFilename));
|
||||
GetModuleFileNameA(handles[h], szFilename, DWORD(std::size(szFilename)));
|
||||
std::string path(szFilename);
|
||||
pushPath(path, libs, paths);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user