Add enforce before calling REPORT_MARKER with invalid marker

v0.27.3
Luis Díaz Más 7 years ago committed by Luis Diaz Mas
parent 5e5d76ad0a
commit 858c99b4df

@ -30,6 +30,7 @@
#include "image_int.hpp" #include "image_int.hpp"
#include "error.hpp" #include "error.hpp"
#include "futils.hpp" #include "futils.hpp"
#include "enforce.hpp"
#ifdef WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
@ -795,6 +796,7 @@ namespace Exiv2 {
if (marker != sos_) { if (marker != sos_) {
// Read the beginning of the next segment // Read the beginning of the next segment
marker = advanceToMarker(); marker = advanceToMarker();
enforce(marker>=0, kerNoImageInInputData);
REPORT_MARKER; REPORT_MARKER;
} }
done |= marker == eoi_ || marker == sos_; done |= marker == eoi_ || marker == sos_;

Loading…
Cancel
Save