From 2fa794f246b0224c458295a271a4246b52eb75c0 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Tue, 23 Mar 2010 12:08:19 -0400 Subject: 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 Reviewed-by: Adam Jackson Signed-off-by: Peter Harris Signed-off-by: Keith Packard (cherry picked from commit 185185eeb44a277c324be0f58a4b4a469b56b69b) --- render/glyph.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/render/glyph.c b/render/glyph.c index 7fcdfd9d1..7282705d5 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -235,6 +235,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); -- cgit v1.2.3