X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19c0043f74cb81d3dc32a8c58be3f51654ffddbc..12b5f4b4d2d8a07962da7ba3b78c8c1ec2634a67:/src/common/xpmdecod.cpp?ds=sidebyside diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index 8d38a3132e..54e54c5221 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -122,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; }