summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2010-03-23 12:08:19 -0400
committerKeith Packard <keithp@keithp.com>2010-03-24 13:02:13 +0100
commit185185eeb44a277c324be0f58a4b4a469b56b69b (patch)
tree774a83bcb7e620d423c0b781cf183e75e377bcea
parent0c2fde5c8ad6e94b4ed1588aa93256a2b64f74d9 (diff)
Fix crash when all glyphs of a given depth are freed, but not all glyphsets
This is how the crash can be triggered with only two clients on the system: Client A: (already running) Client B: Connect Client B: CreateGlyphSet(depthN) Client A: Disconnect Server: free globalGlyphs(depthN) Client B: AddGlyphs(depthN) Server: SEGV This crash was introduced with the FindGlyphsByHash function in 516b96387b0e57b524a37a96da22dbeeeb041712. Before that revision, ResizeGlyphSet was always called before FindGlyphRef, which would re-create globalGlyphs(depthN) if necessary. X.Org Bug 20718 <http://bugs.freedesktop.org/show_bug.cgi?id=20718> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Harris <pharris@opentext.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--render/glyph.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/render/glyph.c b/render/glyph.c
index 0b864ad4d..f0f3b1913 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -217,6 +217,9 @@ FindGlyphByHash (unsigned char sha1[20], int format)
GlyphRefPtr gr;
CARD32 signature = *(CARD32 *) sha1;
+ if (!globalGlyphs[format].hashSet)
+ return NULL;
+
gr = FindGlyphRef (&globalGlyphs[format],
signature, TRUE, sha1);