summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-08-08 15:27:21 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-08-08 15:27:21 -0400
commitac4922bd07db7a513b6dbe5443e95221d7827f79 (patch)
tree2a3120ca081bd9fced5547250e51f7e7ff57e269 /src
parent356e646dc66f3df0d97e2c26e9328650df745c1e (diff)
[TrueType] Zero out padding memory in generated TrueType subset
to make the output deterministic and fix valgrind errors.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-truetype-subset.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 167140e4..f1b0011d 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -339,14 +339,16 @@ static unsigned long
cairo_truetype_font_align_output (cairo_truetype_font_t *font)
{
int length, aligned, pad;
- unsigned char *ignored;
+ unsigned char *padding;
length = _cairo_array_num_elements (&font->output);
aligned = (length + 3) & ~3;
pad = aligned - length;
- if (pad)
- cairo_truetype_font_allocate_write_buffer (font, pad, &ignored);
+ if (pad) {
+ cairo_truetype_font_allocate_write_buffer (font, pad, &padding);
+ memset (padding, 0, pad);
+ }
return aligned;
}