IMG_pnm.c
changeset 95 7fcb46931afc
parent 53 96b084473b47
child 97 e1161bd417c4
equal deleted inserted replaced
94:88ddfd74ad67 95:7fcb46931afc
   105 	Uint8 magic[2];
   105 	Uint8 magic[2];
   106 	int ascii;
   106 	int ascii;
   107 	enum { PBM, PGM, PPM } kind;
   107 	enum { PBM, PGM, PPM } kind;
   108 
   108 
   109 #define ERROR(s) do { error = (s); goto done; } while(0)
   109 #define ERROR(s) do { error = (s); goto done; } while(0)
   110 
       
   111 	if(!src)
       
   112 		return NULL;
       
   113 
   110 
   114 	SDL_RWread(src, magic, 2, 1);
   111 	SDL_RWread(src, magic, 2, 1);
   115 	kind = magic[1] - '1';
   112 	kind = magic[1] - '1';
   116 	ascii = 1;
   113 	ascii = 1;
   117 	if(kind >= 3) {
   114 	if(kind >= 3) {