zero the header info before writing it. this wasn't a critical bug, but it might help debugging and it shuts up valgrind.

SVN revision: 8521
This commit is contained in:
tsauerbeck 2004-01-17 15:01:19 +00:00 committed by tsauerbeck
parent 5c53190442
commit 9a048bd058
1 changed files with 6 additions and 2 deletions

View File

@ -471,12 +471,15 @@ eet_data_image_lossless_convert(int *size, void *data, int w, int h, int alpha)
d = malloc((w * h * 4) + (8 * 4));
if (!d) return NULL;
header = (int *)d;
memset(d, 0, 32);
header[0] = 0xac1dfeed;
header[1] = w;
header[2] = h;
header[3] = alpha;
header[4] = 0;
memcpy(d + 32, data, w * h * 4);
if (words_bigendian)
@ -519,6 +522,8 @@ eet_data_image_lossless_compressed_convert(int *size, void *data, int w, int h,
return NULL;
}
header = (int *)d;
memset(d, 0, 32);
header[0] = 0xac1dfeed;
header[1] = w;
header[2] = h;
@ -1251,7 +1256,6 @@ eet_data_image_read(Eet_File *ef, char *name,
void *data;
int size;
unsigned int *d = NULL;
int header[8];
data = eet_read(ef, name, &size);
if (!data) return NULL;