]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/xpmdecod.cpp
added wx/defs.h include to correct compilation issues under Mac OS X
[wxWidgets.git] / src / common / xpmdecod.cpp
index a0d99a11db2db24a8d8661dba00c578af78de168..434e8dedf911c50dedfa93ea836e0bb20d4e54be 100644 (file)
@@ -137,7 +137,7 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
     size_t i;
 
     if ( stream.Read(xpm_buffer, length).LastError() == wxSTREAM_READ_ERROR )
-        return FALSE;
+        return wxNullImage;
 
     /*
      *  Remove comments from the file:
@@ -203,6 +203,12 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
             lines_cnt++;
     }
 
+    if ( !lines_cnt )
+    {
+        // this doesn't really look an XPM image
+        return wxNullImage;
+    }
+
     xpm_lines = new const char*[lines_cnt];
     xpm_lines[0] = xpm_buffer;
     line = 1;