pango r2813 - in trunk: . pango
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: pango r2813 - in trunk: . pango
- Date: Wed, 28 Jan 2009 23:27:13 +0000 (UTC)
Author: behdad
Date: Wed Jan 28 23:27:13 2009
New Revision: 2813
URL: http://svn.gnome.org/viewvc/pango?rev=2813&view=rev
Log:
2009-01-28 Behdad Esfahbod <behdad gnome org>
Bug 567392 â Abiword crashes in pango when opening document with
certain locales
* pango/pango-ot-info.c (pango_ot_info_find_language),
(pango_ot_info_find_feature), (pango_ot_info_list_languages),
(pango_ot_info_list_features): Protect against more broken fonts.
Modified:
trunk/ChangeLog
trunk/pango/pango-ot-info.c
Modified: trunk/pango/pango-ot-info.c
==============================================================================
--- trunk/pango/pango-ot-info.c (original)
+++ trunk/pango/pango-ot-info.c Wed Jan 28 23:27:13 2009
@@ -522,7 +522,6 @@
return FALSE;
g_return_val_if_fail (script_index < script_list->ScriptCount, FALSE);
-
script = &script_list->ScriptRecord[script_index].Script;
for (i = 0; i < script->LangSysCount; i++)
@@ -610,7 +609,6 @@
return FALSE;
g_return_val_if_fail (script_index < script_list->ScriptCount, FALSE);
-
script = &script_list->ScriptRecord[script_index].Script;
if (language_index == PANGO_OT_DEFAULT_LANGUAGE)
@@ -625,7 +623,8 @@
{
HB_UShort index = lang_sys->FeatureIndex[i];
- if (feature_list->FeatureRecord[index].FeatureTag == feature_tag)
+ if (index < feature_list->FeatureCount &&
+ feature_list->FeatureRecord[index].FeatureTag == feature_tag)
{
if (feature_index)
*feature_index = index;
@@ -706,7 +705,6 @@
return NULL;
g_return_val_if_fail (script_index < script_list->ScriptCount, NULL);
-
script = &script_list->ScriptRecord[script_index].Script;
result = g_new (PangoOTTag, script->LangSysCount + 1);
@@ -748,7 +746,7 @@
HB_ScriptTable *script;
HB_LangSys *lang_sys;
- int i;
+ int i, j;
g_return_val_if_fail (PANGO_IS_OT_INFO (info), NULL);
@@ -763,7 +761,6 @@
return NULL;
g_return_val_if_fail (script_index < script_list->ScriptCount, NULL);
-
script = &script_list->ScriptRecord[script_index].Script;
if (language_index == PANGO_OT_DEFAULT_LANGUAGE)
@@ -776,14 +773,16 @@
result = g_new (PangoOTTag, lang_sys->FeatureCount + 1);
+ j = 0;
for (i = 0; i < lang_sys->FeatureCount; i++)
{
HB_UShort index = lang_sys->FeatureIndex[i];
- result[i] = feature_list->FeatureRecord[index].FeatureTag;
+ if (index < feature_list->FeatureCount)
+ result[j++] = feature_list->FeatureRecord[index].FeatureTag;
}
- result[i] = 0;
+ result[j] = 0;
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]