Zero streaming textures to reduce confusion.

(See mailing list message with subject "Streaming textures not properly initialized?")
This commit is contained in:
Sam Lantinga 2011-02-17 18:58:43 -08:00
parent b898d2680a
commit 147196ba05

View File

@ -312,7 +312,7 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int
} 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;