Skip to content

Commit

Permalink
Fix integer overflow #2179
Browse files Browse the repository at this point in the history
  • Loading branch information
piponazo committed Mar 31, 2022
1 parent 790fc46 commit 62e090a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/jpgimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ DataBuf Photoshop::setIptcIrb(const byte* pPsData, size_t sizePsData, const Iptc
// Write existing stuff after record,
// skip the current and all remaining IPTC blocks
size_t pos = sizeFront;
enforce(pos <= sizePsData, ErrorCode::kerCorruptedMetadata);
while (0 == Photoshop::locateIptcIrb(pPsData + pos, sizePsData - pos, &record, &sizeHdr, &sizeIptc)) {
const auto newPos = static_cast<size_t>(record - pPsData);
// Copy data up to the IPTC IRB
Expand Down

0 comments on commit 62e090a

Please sign in to comment.