Skip to content

Commit

Permalink
Use readOrThrow to check error conditions of iIo.read().
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse authored and piponazo committed May 12, 2021
1 parent d3847d2 commit 0f9eb74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/webpimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,9 @@ namespace Exiv2 {
byte webp[len];
byte data[len];
byte riff[len];
iIo.read(riff, len);
iIo.read(data, len);
iIo.read(webp, len);
readOrThrow(iIo, riff, len, Exiv2::kerCorruptedMetadata);
readOrThrow(iIo, data, len, Exiv2::kerCorruptedMetadata);
readOrThrow(iIo, webp, len, Exiv2::kerCorruptedMetadata);
bool matched_riff = (memcmp(riff, RiffImageId, len) == 0);
bool matched_webp = (memcmp(webp, WebPImageId, len) == 0);
iIo.seek(-12, BasicIo::cur);
Expand Down

0 comments on commit 0f9eb74

Please sign in to comment.