Have example/gifplayer use calloc

This commit is contained in:
Nigel Tao committed 2020-01-26 11:54:42 +11:00
1 parent b781617159
commit 9373749b07
1 file changed
+1 -2
+1 -2
View File
@@ -226,7 +226,7 @@ const char* try_allocate(wuffs_gif__decoder* dec) {
}
dst_len = num_pixels * sizeof(wuffs_base__color_u32_argb_premul);
curr_dst_buffer = (uint8_t*)malloc(dst_len);
curr_dst_buffer = (uint8_t*)calloc(dst_len, 1);
if (!curr_dst_buffer) {
return "could not allocate curr-dst buffer";
}
@@ -320,7 +320,6 @@ const char* play() {
if (!wuffs_base__status__is_ok(&status)) {
return wuffs_base__status__message(&status);
}
memset(curr_dst_buffer, 0, dst_len);
}
while (1) {