comparison src/dmimage.c @ 963:1ffc48d0feaf

Initialize variables so that we don't get garbage in error situations.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Feb 2015 04:59:38 +0200
parents 985225a93aeb
children c71fcf44b678
comparison
equal deleted inserted replaced
962:b7c01d4ca984 963:1ffc48d0feaf
112 112
113 SDL_Surface *dmLoadImage(DMResource *file) 113 SDL_Surface *dmLoadImage(DMResource *file)
114 { 114 {
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, height, comp; 117 int width = 0, height = 0, comp = 0;
118 Uint8 *data; 118 Uint8 *data;
119 119
120 data = stbi_load_from_callbacks(&dmSTBICallbacks, file, &width, &height, &comp, 0); 120 data = stbi_load_from_callbacks(&dmSTBICallbacks, file, &width, &height, &comp, 0);
121 121
122 if (data == NULL) 122 if (data == NULL)