From 858c99b4dfd995b7440a03c99f6a17bb8ca76ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Fri, 30 Mar 2018 08:09:47 +0200 Subject: [PATCH] Add enforce before calling REPORT_MARKER with invalid marker --- src/jpgimage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index cc111485..d6325aa6 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -30,6 +30,7 @@ #include "image_int.hpp" #include "error.hpp" #include "futils.hpp" +#include "enforce.hpp" #ifdef WIN32 #include @@ -795,6 +796,7 @@ namespace Exiv2 { if (marker != sos_) { // Read the beginning of the next segment marker = advanceToMarker(); + enforce(marker>=0, kerNoImageInInputData); REPORT_MARKER; } done |= marker == eoi_ || marker == sos_;