IMG_jpg.c
changeset 343 5bf0f0d6a74e
parent 322 92e073f230d0
child 347 ad5034cad524
     1.1 --- a/IMG_jpg.c	Sun Jan 27 15:55:03 2013 -0800
     1.2 +++ b/IMG_jpg.c	Sun Feb 03 08:37:28 2013 -0800
     1.3 @@ -177,7 +177,7 @@
     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 +	Sint64 start;
     1.9  	int is_JPG;
    1.10  	int in_scan;
    1.11  	Uint8 magic[4];
    1.12 @@ -214,13 +214,13 @@
    1.13  					is_JPG = 0;
    1.14  				} else {
    1.15  					/* Yes, it's big-endian */
    1.16 -					Uint32 start;
    1.17 +					Sint64 innerStart;
    1.18  					Uint32 size;
    1.19 -					Uint32 end;
    1.20 -					start = SDL_RWtell(src);
    1.21 +					Sint64 end;
    1.22 +					innerStart = SDL_RWtell(src);
    1.23  					size = (magic[2] << 8) + magic[3];
    1.24  					end = SDL_RWseek(src, size-2, RW_SEEK_CUR);
    1.25 -					if ( end != start + size - 2 ) is_JPG = 0;
    1.26 +					if ( end != innerStart + size - 2 ) is_JPG = 0;
    1.27  					if ( magic[1] == 0xDA ) {
    1.28  						/* Now comes the actual JPEG meat */
    1.29  #ifdef	FAST_IS_JPEG
    1.30 @@ -374,7 +374,7 @@
    1.31  /* Load a JPEG type image from an SDL datasource */
    1.32  SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
    1.33  {
    1.34 -	int start;
    1.35 +	Sint64 start;
    1.36  	struct jpeg_decompress_struct cinfo;
    1.37  	JSAMPROW rowptr[1];
    1.38  	SDL_Surface *volatile surface = NULL;