Fix access to uninitialized data

key must be first element in cache entry
This commit is contained in:
Alexander Larsson 2005-01-26 06:49:16 +00:00
parent 2a7a9d00cc
commit dfee909d51
5 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2005-01-26 Alexander Larsson <alexl@redhat.com>
* src/cairo_ft_font.c: (_ft_unscaled_font_set_scale):
Fix access to uninitialized data
* src/cairo_xlib_surface.c:
key must be first element in cache entry
2005-01-25 David Reveman <davidr@novell.com>
* AUTHORS: Update mail address.

View file

@ -445,12 +445,14 @@ _ft_unscaled_font_set_scale (ft_unscaled_font_t *unscaled,
assert (unscaled->face != NULL);
if (scale->matrix[0][0] == unscaled->current_scale.matrix[0][0] &&
if (unscaled->have_scale &&
scale->matrix[0][0] == unscaled->current_scale.matrix[0][0] &&
scale->matrix[0][1] == unscaled->current_scale.matrix[0][1] &&
scale->matrix[1][0] == unscaled->current_scale.matrix[1][0] &&
scale->matrix[1][1] == unscaled->current_scale.matrix[1][1])
return;
unscaled->have_scale = 1;
unscaled->current_scale = *scale;
_compute_transform (&sf, scale);

View file

@ -823,10 +823,10 @@ typedef struct glyphset_cache {
} glyphset_cache_t;
typedef struct {
int refcount;
cairo_glyph_cache_key_t key;
Glyph glyph;
XGlyphInfo info;
int refcount;
} glyphset_cache_entry_t;
static Glyph

View file

@ -445,12 +445,14 @@ _ft_unscaled_font_set_scale (ft_unscaled_font_t *unscaled,
assert (unscaled->face != NULL);
if (scale->matrix[0][0] == unscaled->current_scale.matrix[0][0] &&
if (unscaled->have_scale &&
scale->matrix[0][0] == unscaled->current_scale.matrix[0][0] &&
scale->matrix[0][1] == unscaled->current_scale.matrix[0][1] &&
scale->matrix[1][0] == unscaled->current_scale.matrix[1][0] &&
scale->matrix[1][1] == unscaled->current_scale.matrix[1][1])
return;
unscaled->have_scale = 1;
unscaled->current_scale = *scale;
_compute_transform (&sf, scale);

View file

@ -823,10 +823,10 @@ typedef struct glyphset_cache {
} glyphset_cache_t;
typedef struct {
int refcount;
cairo_glyph_cache_key_t key;
Glyph glyph;
XGlyphInfo info;
int refcount;
} glyphset_cache_entry_t;
static Glyph