IMG_bmp.c
changeset 117 e613cf987897
parent 106 65e8cd587119
child 118 c5e736a47ad2
     1.1 --- a/IMG_bmp.c	Sat Feb 04 04:53:36 2006 +0000
     1.2 +++ b/IMG_bmp.c	Sat Feb 04 20:37:17 2006 +0000
     1.3 @@ -34,15 +34,18 @@
     1.4  /* See if an image is contained in a data source */
     1.5  int IMG_isBMP(SDL_RWops *src)
     1.6  {
     1.7 +	int start;
     1.8  	int is_BMP;
     1.9  	char magic[2];
    1.10  
    1.11 +	start = SDL_RWtell(src);
    1.12  	is_BMP = 0;
    1.13 -	if ( SDL_RWread(src, magic, 2, 1) ) {
    1.14 +	if ( SDL_RWread(src, magic, sizeof(magic), 1) ) {
    1.15  		if ( strncmp(magic, "BM", 2) == 0 ) {
    1.16  			is_BMP = 1;
    1.17  		}
    1.18  	}
    1.19 +	SDL_RWseek(src, start, SEEK_SET);
    1.20  	return(is_BMP);
    1.21  }
    1.22