X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b81e45065986abc34676fecc31515efeb3f3a8d4..41550985f202b60e7e50142113b19e633d578bf0:/src/common/imagiff.cpp diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp index 9fd15214d4..2ea52b1403 100644 --- a/src/common/imagiff.cpp +++ b/src/common/imagiff.cpp @@ -98,7 +98,10 @@ public: // constructor, destructor, etc. wxIFFDecoder(wxInputStream *s); ~wxIFFDecoder() { Destroy(); } + + // NOTE: this function modifies the current stream position bool CanRead(); + int ReadIFF(); bool ConvertToImage(wxImage *image) const; }; @@ -234,9 +237,6 @@ bool wxIFFDecoder::CanRead() if ( !m_f->Read(buf, WXSIZEOF(buf)) ) return false; - if ( m_f->SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent) == wxInvalidOffset ) - return false; - return (memcmp(buf, "FORM", 4) == 0) && (memcmp(buf+8, "ILBM", 4) == 0); } @@ -787,6 +787,7 @@ bool wxIFFHandler::DoCanRead(wxInputStream& stream) wxIFFDecoder decod(&stream); return decod.CanRead(); + // it's ok to modify the stream position here } #endif // wxUSE_STREAMS