comparison src/dmimage.c @ 1042:c71fcf44b678

Image resources may get decoded multiple times, so seek to node start.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 01 Mar 2015 17:31:48 +0200
parents 1ffc48d0feaf
children 7e54b2d08ce7
comparison
equal deleted inserted replaced
1041:d0f80f6a0c65 1042:c71fcf44b678
115 Uint32 rmask, gmask, bmask, amask; 115 Uint32 rmask, gmask, bmask, amask;
116 SDL_Surface *result = NULL; 116 SDL_Surface *result = NULL;
117 int width = 0, height = 0, comp = 0; 117 int width = 0, height = 0, comp = 0;
118 Uint8 *data; 118 Uint8 *data;
119 119
120 dmfseek(file, 0, SEEK_SET);
120 data = stbi_load_from_callbacks(&dmSTBICallbacks, file, &width, &height, &comp, 0); 121 data = stbi_load_from_callbacks(&dmSTBICallbacks, file, &width, &height, &comp, 0);
121 122
122 if (data == NULL) 123 if (data == NULL)
123 { 124 {
124 dmError(DMERR_DATA_ERROR, 125 dmError(DMERR_DATA_ERROR,