X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/942368061731ed2a42949287dfd1281e8c28b22d..d7928233956f3c56fd402e0e496f7da238510b61:/src/common/xpmdecod.cpp diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index ae43e513fd..54e54c5221 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -108,6 +108,7 @@ license is as follows: #include "wx/hashmap.h" #include "wx/stream.h" #include "wx/image.h" + #include "wx/palette.h" #endif #include @@ -121,7 +122,8 @@ bool wxXPMDecoder::CanRead(wxInputStream& stream) if ( !stream.Read(buf, WXSIZEOF(buf)) ) return false; - stream.SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent); + if (stream.SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent) == wxInvalidOffset) + return false; return memcmp(buf, "/* XPM */", WXSIZEOF(buf)) == 0; }