... | ... |
@@ -76,7 +76,7 @@ ppu_init(Ppu *p, Uint8 hor, Uint8 ver) |
76 | 76 |
{ |
77 | 77 |
p->width = 8 * hor; |
78 | 78 |
p->height = 8 * ver; |
79 |
- p->bg = malloc(p->width / 4 * p->height * sizeof(Uint8)); |
|
80 |
- p->fg = malloc(p->width / 4 * p->height * sizeof(Uint8)); |
|
79 |
+ p->bg = calloc(1, p->width / 4 * p->height * sizeof(Uint8)); |
|
80 |
+ p->fg = calloc(1, p->width / 4 * p->height * sizeof(Uint8)); |
|
81 | 81 |
return 1; |
82 | 82 |
} |