5d7b1c1
From 82e46b5524fb904e6660dadd2c6d8e5e47375a1a Mon Sep 17 00:00:00 2001
5d7b1c1
From: Kevin Backhouse <kevinbackhouse@github.com>
5d7b1c1
Date: Tue, 11 May 2021 12:14:33 +0100
5d7b1c1
Subject: [PATCH] Use readOrThrow to check error conditions of iIo.read().
5d7b1c1
5d7b1c1
---
5d7b1c1
 src/webpimage.cpp | 6 +++---
5d7b1c1
 1 file changed, 3 insertions(+), 3 deletions(-)
5d7b1c1
5d7b1c1
diff --git a/src/webpimage.cpp b/src/webpimage.cpp
5d7b1c1
index 7c64ff3d7..ca26e514a 100644
5d7b1c1
--- a/src/webpimage.cpp
5d7b1c1
+++ b/src/webpimage.cpp
5d7b1c1
@@ -754,9 +754,9 @@ namespace Exiv2 {
5d7b1c1
         byte webp[len];
5d7b1c1
         byte data[len];
5d7b1c1
         byte riff[len];
5d7b1c1
-        iIo.read(riff, len);
5d7b1c1
-        iIo.read(data, len);
5d7b1c1
-        iIo.read(webp, len);
5d7b1c1
+        readOrThrow(iIo, riff, len, Exiv2::kerCorruptedMetadata);
5d7b1c1
+        readOrThrow(iIo, data, len, Exiv2::kerCorruptedMetadata);
5d7b1c1
+        readOrThrow(iIo, webp, len, Exiv2::kerCorruptedMetadata);
5d7b1c1
         bool matched_riff = (memcmp(riff, RiffImageId, len) == 0);
5d7b1c1
         bool matched_webp = (memcmp(webp, WebPImageId, len) == 0);
5d7b1c1
         iIo.seek(-12, BasicIo::cur);