diff --git a/src/epsimage.cpp b/src/epsimage.cpp index c916eeffb7..f60b2b0f66 100644 --- a/src/epsimage.cpp +++ b/src/epsimage.cpp @@ -1175,8 +1175,12 @@ namespace Exiv2 // check for all possible (DOS) EPS signatures bool matched = (memcmp(buf.pData_, dosEpsSignature.data(), dosEpsSignature.size()) == 0); if (!matched) { - for (auto&& eps : epsFirstLine) - matched = (memcmp(buf.pData_, eps.data(), eps.size()) == 0); + for (auto&& eps : epsFirstLine) { + if (memcmp(buf.pData_, eps.data(), eps.size()) == 0) { + matched = true; + break; + } + } } // seek back if possible and requested if (!advance || !matched) {