diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-26 08:13:28 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-27 10:18:25 +0100 |
commit | 25858d524d158531a71a2e772551b1e497d9d423 (patch) | |
tree | 8893e849371233052fdc06e457b496f2635e6a76 /util | |
parent | ede0f7e7df4e17ddc1ffe98dcdfe0115a58e7b14 (diff) |
[script] Fix reference to font source after transferring to mmap
After diverting the pointers to accommodate lazy decompressing of the
source, the bytecode pointer was left pointing to the original location
that had already been freed - thus passing an invalid block to FreeType
and unsurprisingly then, blowing up.
Diffstat (limited to 'util')
-rw-r--r-- | util/cairo-script/cairo-script-operators.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c index b7699949d..b1f287eb3 100644 --- a/util/cairo-script/cairo-script-operators.c +++ b/util/cairo-script/cairo-script-operators.c @@ -1709,6 +1709,12 @@ _ft_create_for_source (csi_t *ctx, if (--source->base.ref == 0) csi_string_free (ctx, source); + if (source->deflate) { + _csi_free (ctx, bytes); + bytes = data->blob.bytes + vec[0].num_bytes; + } else + bytes = data->blob.bytes; + data->source = NULL; data->bytes = NULL; } else { |