]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagiff.cpp
Ensure that component levels map is initialized before it's used (closes #10990).
[wxWidgets.git] / src / common / imagiff.cpp
index 9fd15214d4adeeed246f67ad998720204256c314..2c7dd954543b960c900c61ab08d72421517c3180 100644 (file)
@@ -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);
 }
 
@@ -777,7 +777,9 @@ bool wxIFFHandler::SaveFile(wxImage * WXUNUSED(image),
                             wxOutputStream& WXUNUSED(stream), bool verbose)
 {
     if (verbose)
+    {
         wxLogDebug(wxT("IFF: the handler is read-only!!"));
+    }
 
     return false;
 }
@@ -787,6 +789,7 @@ bool wxIFFHandler::DoCanRead(wxInputStream& stream)
     wxIFFDecoder decod(&stream);
 
     return decod.CanRead();
+         // it's ok to modify the stream position here
 }
 
 #endif // wxUSE_STREAMS