IMG_jpg.c
changeset 117 e613cf987897
parent 109 0d1bd5675598
child 118 c5e736a47ad2
     1.1 --- a/IMG_jpg.c	Sat Feb 04 04:53:36 2006 +0000
     1.2 +++ b/IMG_jpg.c	Sat Feb 04 20:37:17 2006 +0000
     1.3 @@ -40,9 +40,11 @@
     1.4  /* See if an image is contained in a data source */
     1.5  int IMG_isJPG(SDL_RWops *src)
     1.6  {
     1.7 +	int start;
     1.8  	int is_JPG;
     1.9  	Uint8 magic[4];
    1.10  
    1.11 +	start = SDL_RWtell(src);
    1.12  	is_JPG = 0;
    1.13  	if ( SDL_RWread(src, magic, 2, 1) ) {
    1.14  		if ( (magic[0] == 0xFF) && (magic[1] == 0xD8) ) {
    1.15 @@ -61,6 +63,7 @@
    1.16  			}
    1.17  		}
    1.18  	}
    1.19 +	SDL_RWseek(src, start, SEEK_SET);
    1.20  	return(is_JPG);
    1.21  }
    1.22