Blob Blame History Raw
--- IMG_xpm.c~	2006-05-12 05:02:44.000000000 +0200
+++ IMG_xpm.c	2006-10-31 19:03:25.000000000 +0100
@@ -326,7 +326,8 @@
 	linebuf = NULL;
 	buflen = 0;
 
-	start = SDL_RWtell(src);
+    if(src)
+        start = SDL_RWtell(src);
 
 	if(xpm)
 		xpmlines = &xpm;
@@ -453,7 +454,8 @@
 
 done:
 	if(error) {
-		SDL_RWseek(src, start, SEEK_SET);
+        if (src)
+            SDL_RWseek(src, start, SEEK_SET);
 		if ( image ) {
 			SDL_FreeSurface(image);
 			image = NULL;