Skip to content

Commit

Permalink
try to actually fix null pointer deref
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Apr 9, 2022
1 parent 25ef5d7 commit 89b8d4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/makernote_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 89b8d4e

Please sign in to comment.