From 43f154f44b838e6b232193ccbd48e5a2e94bdd35 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Tue, 14 May 2019 09:58:42 +0100 Subject: [PATCH] Merge two enforces into one. --- src/pngchunk_int.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pngchunk_int.cpp b/src/pngchunk_int.cpp index 64a370e5..714b95b4 100644 --- a/src/pngchunk_int.cpp +++ b/src/pngchunk_int.cpp @@ -668,8 +668,7 @@ namespace Exiv2 { } long length = (long) atol(startOfLength); - enforce(length >= 0, Exiv2::kerCorruptedMetadata); - enforce(length <= (eot - sp)/2, Exiv2::kerCorruptedMetadata); + enforce(0 <= length && length <= (eot - sp)/2, Exiv2::kerCorruptedMetadata); // Allocate space if (length == 0)