Skip to content

Commit

Permalink
Fix access to null pointer in TiffParser
Browse files Browse the repository at this point in the history
  • Loading branch information
piponazo committed Feb 19, 2019
1 parent 3ec6aeb commit 9296067
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/tiffimage_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,10 +1670,10 @@ namespace Exiv2 {

} // TiffParserWorker::parse

void TiffParserWorker::findPrimaryGroups(PrimaryGroups& primaryGroups,
TiffComponent* pSourceDir)
void TiffParserWorker::findPrimaryGroups(PrimaryGroups& primaryGroups, TiffComponent* pSourceDir)
{
if (0 == pSourceDir) return;
if (0 == pSourceDir)
return;

const IfdId imageGroups[] = {
ifd0Id,
Expand All @@ -1695,10 +1695,8 @@ namespace Exiv2 {
TiffFinder finder(0x00fe, imageGroups[i]);
pSourceDir->accept(finder);
TiffEntryBase* te = dynamic_cast<TiffEntryBase*>(finder.result());
if ( te
&& te->pValue()->typeId() == unsignedLong
&& te->pValue()->count() == 1
&& (te->pValue()->toLong() & 1) == 0) {
const Value* pV = te != NULL ? te->pValue() : NULL;
if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toLong() & 1) == 0) {
primaryGroups.push_back(te->group());
}
}
Expand Down

0 comments on commit 9296067

Please sign in to comment.