From b814bf5c6da9bc191d1c6b03c71363b32c3e81d9 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 26 Apr 2012 18:48:05 +0100 Subject: [PATCH] bug 739858 - don't try to actually load a font if the proxy has been detached from its family. r=jdaggett --- gfx/thebes/gfxUserFontSet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 4291a38a044..88641e338a5 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -622,6 +622,14 @@ gfxFontEntry* gfxUserFontSet::LoadFont(gfxProxyFontEntry *aProxy, const PRUint8 *aFontData, PRUint32 &aLength) { + // if the proxy doesn't belong to a family, we just bail as it won't be + // accessible/usable anyhow (maybe the font set got modified right as + // the load was completing?) + if (!aProxy->Family()) { + NS_Free(aFontData); + return nsnull; + } + gfxFontEntry *fe = nsnull; gfxUserFontType fontType =