]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/gifdecod.cpp
Applied patch [ 686843 ] File Dialog Wildcard Bug
[wxWidgets.git] / src / common / gifdecod.cpp
index 011d8cf3ad06e2d385bbc767bb450ed19f04eaaf..229050812f200b935d9cee6a648858e3edb8386f 100644 (file)
@@ -21,6 +21,7 @@
 
 #ifndef WX_PRECOMP
 #  include "wx/defs.h"
+#  include "wx/palette.h"
 #endif
 
 #if wxUSE_STREAMS && wxUSE_GIF
@@ -617,10 +618,12 @@ bool wxGIFDecoder::CanRead()
 {
     unsigned char buf[3];
 
-    m_f->Read(buf, 3);
-    m_f->SeekI(-3, wxFromCurrent);
+    if ( !m_f->Read(buf, WXSIZEOF(buf)) )
+        return FALSE;
+
+    m_f->SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent);
 
-    return (memcmp(buf, "GIF", 3) == 0);
+    return memcmp(buf, "GIF", WXSIZEOF(buf)) == 0;
 }