IMG_gif.c
changeset 117 e613cf987897
parent 97 e1161bd417c4
child 118 c5e736a47ad2
     1.1 --- a/IMG_gif.c	Sat Feb 04 04:53:36 2006 +0000
     1.2 +++ b/IMG_gif.c	Sat Feb 04 20:37:17 2006 +0000
     1.3 @@ -34,17 +34,20 @@
     1.4  /* See if an image is contained in a data source */
     1.5  int IMG_isGIF(SDL_RWops *src)
     1.6  {
     1.7 +	int start;
     1.8  	int is_GIF;
     1.9  	char magic[6];
    1.10  
    1.11 +	start = SDL_RWtell(src);
    1.12  	is_GIF = 0;
    1.13 -	if ( SDL_RWread(src, magic, 6, 1) ) {
    1.14 +	if ( SDL_RWread(src, magic, sizeof(magic), 1) ) {
    1.15  		if ( (strncmp(magic, "GIF", 3) == 0) &&
    1.16  		     ((memcmp(magic + 3, "87a", 3) == 0) ||
    1.17  		      (memcmp(magic + 3, "89a", 3) == 0)) ) {
    1.18  			is_GIF = 1;
    1.19  		}
    1.20  	}
    1.21 +	SDL_RWseek(src, start, SEEK_SET);
    1.22  	return(is_GIF);
    1.23  }
    1.24