Description: Fixes for causing crashes in several applications This patch consists of all the code changes from pango-graphite v0.9.2 to v0.9.3, with autotools and documentation changes stripped. . The patch was created for an Ubuntu "Stable Release Update" and solves several crashes which pango-graphite caused in other applications, for example GDM. Origin: upstream, http://sourceforge.net/projects/silgraphite/files/pango-graphite/0.9.3/pango-graphite-0.9.3.tar.gz Bug-Ubuntu: https://launchpad.net/bugs/540035 Bug-Debian: http://bugs.debian.org/471642 Forwarded: not-needed Last-Update: 2012-07-06 diff -Nurp pango-graphite-0.9.2/graphite-module.c pango-graphite-0.9.3/graphite-module.c --- pango-graphite-0.9.2/graphite-module.c 2007-08-27 18:26:02.000000000 +0200 +++ pango-graphite-0.9.3/graphite-module.c 2008-04-07 09:35:07.000000000 +0200 @@ -44,7 +44,11 @@ typedef PangoEngineLangClass GraphiteEng static PangoEngineScriptInfo graphite_scripts[] = { +#if (PANGO_MAJOR_VERSION > 1 || PANGO_MINOR_VERSION > 18) + { PANGO_SCRIPT_COMMON, "" }, /* Zyyy */ +#else { PANGO_SCRIPT_COMMON, "*" }, /* Zyyy */ +#endif { PANGO_SCRIPT_INHERITED, "*" }, /* Qaai */ { PANGO_SCRIPT_ARABIC, "*" }, /* Arab */ { PANGO_SCRIPT_ARMENIAN, "*" }, /* Armn */ diff -Nurp pango-graphite-0.9.2/graphitecache.h pango-graphite-0.9.3/graphitecache.h --- pango-graphite-0.9.2/graphitecache.h 2007-08-27 18:26:02.000000000 +0200 +++ pango-graphite-0.9.3/graphitecache.h 2008-05-09 06:55:52.000000000 +0200 @@ -25,6 +25,7 @@ #include "PangoTextSrc.h" #include "PangoGrFont.h" #include +#include using gr::PangoTextSrc; using gr::PangoGrFont; diff -Nurp pango-graphite-0.9.2/pangographite.cpp pango-graphite-0.9.3/pangographite.cpp --- pango-graphite-0.9.2/pangographite.cpp 2007-08-27 18:26:02.000000000 +0200 +++ pango-graphite-0.9.3/pangographite.cpp 2008-05-09 06:54:01.000000000 +0200 @@ -27,6 +27,8 @@ typedef std::pair GlyphRange; typedef std::pair GrGlyphSet; +static gr::LayoutEnvironment default_layout; + void graphite_PangoLogAttrs(const char *text, int length, PangoFcFont *xftfont, @@ -47,13 +49,14 @@ void graphite_PangoLogAttrs(const char } RangeSegment *grseg = NULL; - grseg = graphite_GetSegment(pTextSrc, pgrFont); + grseg = graphite_GetSegment(pTextSrc, pgrFont); if (!grseg) { try { + default_layout.setDumbFallback(true); pgrFont->lockFace(); - grseg = new RangeSegment(pgrFont, pTextSrc, NULL, 0, length); + grseg = new RangeSegment(pgrFont, pTextSrc, &default_layout, 0, length); pgrFont->unlockFace(); graphite_CacheSegment(pTextSrc, pgrFont, grseg); } @@ -187,8 +190,9 @@ void graphite_PangoGlyphString(const cha grseg = graphite_GetSegment(pTextSrc, pgrFont); if (!grseg) { + default_layout.setDumbFallback(true); pgrFont->lockFace(); - grseg = new RangeSegment(pgrFont, pTextSrc, NULL, 0, length); + grseg = new RangeSegment(pgrFont, pTextSrc, &default_layout, 0, length); pgrFont->unlockFace(); graphite_CacheSegment(pTextSrc, pgrFont, grseg); }