equal
deleted
inserted
replaced
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 } |