size_t i;
if ( stream.Read(xpm_buffer, length).LastError() == wxSTREAM_READ_ERROR )
- return FALSE;
+ return wxNullImage;
/*
* Remove comments from the file:
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;