src/render/opengl/SDL_render_gl.c
changeset 5402 5d102cd8aef3
parent 5397 88ff1f463134
child 5465 46bd121b04a2
equal deleted inserted replaced
5401:ccaccc76a196 5402:5d102cd8aef3
   425         if (texture->format == SDL_PIXELFORMAT_YV12 ||
   425         if (texture->format == SDL_PIXELFORMAT_YV12 ||
   426             texture->format == SDL_PIXELFORMAT_IYUV) {
   426             texture->format == SDL_PIXELFORMAT_IYUV) {
   427             /* Need to add size for the U and V planes */
   427             /* Need to add size for the U and V planes */
   428             size += (2 * (texture->h * data->pitch) / 4);
   428             size += (2 * (texture->h * data->pitch) / 4);
   429         }
   429         }
   430         data->pixels = SDL_malloc(size);
   430         data->pixels = SDL_calloc(1, size);
   431         if (!data->pixels) {
   431         if (!data->pixels) {
   432             SDL_OutOfMemory();
   432             SDL_OutOfMemory();
   433             SDL_free(data);
   433             SDL_free(data);
   434             return -1;
   434             return -1;
   435         }
   435         }