IMG_lbm.c
changeset 117 e613cf987897
parent 104 e77df0fdb882
child 118 c5e736a47ad2
     1.1 --- a/IMG_lbm.c	Sat Feb 04 04:53:36 2006 +0000
     1.2 +++ b/IMG_lbm.c	Sat Feb 04 20:37:17 2006 +0000
     1.3 @@ -63,11 +63,13 @@
     1.4  
     1.5  int IMG_isLBM( SDL_RWops *src )
     1.6  {
     1.7 +	int start;
     1.8  	int   is_LBM;
     1.9  	Uint8 magic[4+4+4];
    1.10  
    1.11 +	start = SDL_RWtell(src);
    1.12  	is_LBM = 0;
    1.13 -	if ( SDL_RWread( src, magic, 4+4+4, 1 ) )
    1.14 +	if ( SDL_RWread( src, magic, sizeof(magic), 1 ) )
    1.15  	{
    1.16  		if ( !memcmp( magic, "FORM", 4 ) &&
    1.17  			( !memcmp( magic + 8, "PBM ", 4 ) ||
    1.18 @@ -76,6 +78,7 @@
    1.19  			is_LBM = 1;
    1.20  		}
    1.21  	}
    1.22 +	SDL_RWseek(src, start, SEEK_SET);
    1.23  	return( is_LBM );
    1.24  }
    1.25