Zero streaming textures to reduce confusion.
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Feb 2011 18:58:43 -0800
changeset 5342d4b691de3b8f
parent 5341 fcde22671032
child 5343 0650b90ddc0e
Zero streaming textures to reduce confusion.
(See mailing list message with subject "Streaming textures not properly initialized?")
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Thu Feb 17 18:55:56 2011 -0800
     1.2 +++ b/src/render/SDL_render.c	Thu Feb 17 18:58:43 2011 -0800
     1.3 @@ -312,7 +312,7 @@
     1.4          } else if (access == SDL_TEXTUREACCESS_STREAMING) {
     1.5              /* The pitch is 4 byte aligned */
     1.6              texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3);
     1.7 -            texture->pixels = SDL_malloc(texture->pitch * h);
     1.8 +            texture->pixels = SDL_calloc(1, texture->pitch * h);
     1.9              if (!texture->pixels) {
    1.10                  SDL_DestroyTexture(texture);
    1.11                  return NULL;