Zero streaming textures to reduce confusion.
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Feb 2011 18:58:43 -0800
changeset 5342 d4b691de3b8f
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
--- a/src/render/SDL_render.c	Thu Feb 17 18:55:56 2011 -0800
+++ b/src/render/SDL_render.c	Thu Feb 17 18:58:43 2011 -0800
@@ -312,7 +312,7 @@
         } else if (access == SDL_TEXTUREACCESS_STREAMING) {
             /* The pitch is 4 byte aligned */
             texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3);
-            texture->pixels = SDL_malloc(texture->pitch * h);
+            texture->pixels = SDL_calloc(1, texture->pitch * h);
             if (!texture->pixels) {
                 SDL_DestroyTexture(texture);
                 return NULL;