src/render/opengles2/SDL_render_gles2.c
changeset 5402 5d102cd8aef3
parent 5355 cc2215cda170
child 5484 e20c93bc9122
equal deleted inserted replaced
5401:ccaccc76a196 5402:5d102cd8aef3
   270 
   270 
   271     /* Allocate a blob for image data */
   271     /* Allocate a blob for image data */
   272     if (texture->access == SDL_TEXTUREACCESS_STREAMING)
   272     if (texture->access == SDL_TEXTUREACCESS_STREAMING)
   273     {
   273     {
   274         tdata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
   274         tdata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
   275         tdata->pixel_data = SDL_malloc(tdata->pitch * texture->h);
   275         tdata->pixel_data = SDL_calloc(1, tdata->pitch * texture->h);
   276         if (!tdata->pixel_data)
   276         if (!tdata->pixel_data)
   277         {
   277         {
   278             SDL_OutOfMemory();
   278             SDL_OutOfMemory();
   279             SDL_free(tdata);
   279             SDL_free(tdata);
   280             return -1;
   280             return -1;