summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-07-26 18:33:27 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-07-26 18:33:27 +0000
commit53c8ab88ac475f162e94d9be79c1c66c3e99fc51 (patch)
tree6a4be72b0fd4a6aa597320393c7049e97600a297
parent1e2a822b0ab4ca453f49f5496ddb3f504a49e2a8 (diff)
downloadpango-53c8ab88ac475f162e94d9be79c1c66c3e99fc51.tar.gz
Skip lookups with lookup index out of range. (Patch from Behdad Esfahbod,
2005-07-26 Owen Taylor <otaylor@redhat.com> * pango/opentype/ftxgsub.c, pango/opentype/ftxgpos.c: Skip lookups with lookup index out of range. (Patch from Behdad Esfahbod, #171170)
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLog.pre-1-1010
-rw-r--r--NEWS31
-rw-r--r--pango/opentype/ftxgpos.c30
-rw-r--r--pango/opentype/ftxgsub.c30
5 files changed, 91 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 13338621..af161bf8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-26 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c, pango/opentype/ftxgpos.c: Skip lookups
+ with lookup index out of range. (Patch from Behdad Esfahbod, #171170)
+
2005-07-26 Owen Taylor <otaylor@redhat.com>
* pango/pangocairo-fontmap.c (pango_cairo_context_get_font_options):
@@ -52,6 +57,11 @@
2005-07-26 Behdad Esfahbod <pango@behdad.org>
+ * pango/opentype/ftxgsub.c, pango/opentype/ftxgpos.c: Skip lookups
+ with lookup index out of range. (#171170)
+
+2005-07-26 Behdad Esfahbod <pango@behdad.org>
+
* examples/cairoview.c, examples/pangoft2topgm.c,
examples/renderdemo.c, examples/renderdemo.h: Fixed a couple of leaks
and freed memory after use.
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 13338621..af161bf8 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,8 @@
+2005-07-26 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c, pango/opentype/ftxgpos.c: Skip lookups
+ with lookup index out of range. (Patch from Behdad Esfahbod, #171170)
+
2005-07-26 Owen Taylor <otaylor@redhat.com>
* pango/pangocairo-fontmap.c (pango_cairo_context_get_font_options):
@@ -52,6 +57,11 @@
2005-07-26 Behdad Esfahbod <pango@behdad.org>
+ * pango/opentype/ftxgsub.c, pango/opentype/ftxgpos.c: Skip lookups
+ with lookup index out of range. (#171170)
+
+2005-07-26 Behdad Esfahbod <pango@behdad.org>
+
* examples/cairoview.c, examples/pangoft2topgm.c,
examples/renderdemo.c, examples/renderdemo.h: Fixed a couple of leaks
and freed memory after use.
diff --git a/NEWS b/NEWS
index 04ff7816..58f92ad3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,12 @@
-verview of changes between 1.8.x and 1.9.x
+overview of changes between 1.9.0 and 1.9.1
+==========================================
+* Support setting of font options and DPI on PangoContext for
+ the Cairo backend.
+* Adapt to recent Cairo API changes
+* Win32 build improvements [Tor Lillqvist]
+* Misc bug fixes [Hans Breuer, Thomas Fitzsimmons]
+
+Overview of changes between 1.8.x and 1.9.x
===========================================
* Add Cairo support; PangoCairoFontmap is an interface with
implementations for Fontconfig fonts and Win32 fonts
@@ -11,19 +19,26 @@ verview of changes between 1.8.x and 1.9.x
============================================================
-Overview of changes since 1.8.1
-===============================
+Overview of changes between 1.8.1 and 1.8.2
+===========================================
+* Add Khmer support [Jens Herden, Javier Sola]
+* Fix bugs and crashes in the operation of PangoLayoutIter [Amit Aronovitch]
* Increase sharing of data between different copies of Pango
[Tommi Komulainen, Ross Burton]
+* Remove dependence of opentype code on FreeType internals [David Turner,
+ Behdad Esfahbod]
+* Better handling of MacThai encoded fonts [Theppitak Karoonboonyanan]
* Cache metrics for the Win32 backend [Tor Lillqvist]
* Improve handling of RTL text when passing it to Uniscribe [Tor]
-* Better handling of MacThai encoded fonts [Theppitak Karoonboonyanan]
-* Support for TrueType fonts with characters outside the BMP [Tor]
+* Support for TrueType fonts on Win32 with characters outside the BMP [Tor]
+* Handle alpha in XftColors again. [Mikael Magnusson]
* Handle zero width chars properly in Hangul backend
[Young-Ho Cha, Changwoo Ryu]
-* Misc bug and build fixes [Sebastien Bacher, Paolo Borelli,
- Aivars Kalvans, Stepan Kasal, Ben Maurer, Sukhjinder Sidhu, Manish Singh,
- Morten Welinder]
+* Clean up copyright/licensing information [William N. Ray]
+* Misc bug and build fixes [Sebastien Bacher, Brandon Bergren,
+ Chris Blizzard, Paolo Borelli, Behdad, Harshula, Alex Jones, Aivars Kalvans,
+ Stepan Kasal, Karel Kulhavy, Ryan Lortie, Ben Maurer, Sukhjinder Sidhu,
+ Manish Singh, Emil Soleyman-Zomalan, Morten Welinder]
Overview of changes between 1.8.0 and 1.8.1
===========================================
diff --git a/pango/opentype/ftxgpos.c b/pango/opentype/ftxgpos.c
index e2a71ed4..a3d163ea 100644
--- a/pango/opentype/ftxgpos.c
+++ b/pango/opentype/ftxgpos.c
@@ -5872,8 +5872,8 @@
FT_UShort context_length,
int nesting_level )
{
- FT_Error error = TT_Err_Ok;
- FT_UShort i, flags;
+ FT_Error error = TTO_Err_Not_Covered;
+ FT_UShort i, flags, lookup_count;
TTO_GPOSHeader* gpos = gpi->gpos;
TTO_Lookup* lo;
@@ -5883,6 +5883,10 @@
if ( nesting_level > TTO_MAX_NESTING_LEVEL )
return TTO_Err_Too_Many_Nested_Contexts;
+ lookup_count = gpos->LookupList.LookupCount;
+ if (lookup_index >= lookup_count)
+ return error;
+
lo = &gpos->LookupList.Lookup[lookup_index];
flags = lo->LookupFlag;
@@ -6049,8 +6053,9 @@
TTO_Feature feature;
FT_UInt* properties;
FT_UShort* index;
+ FT_UShort lookup_count;
- /* Each feature can only be added once once */
+ /* Each feature can only be added once */
if ( !gpos ||
feature_index >= gpos->FeatureList.FeatureCount ||
@@ -6063,9 +6068,14 @@
feature = gpos->FeatureList.FeatureRecord[feature_index].Feature;
index = feature.LookupListIndex;
+ lookup_count = gpos->LookupList.LookupCount;
for ( i = 0; i < feature.LookupListCount; i++ )
- properties[index[i]] |= property;
+ {
+ FT_UShort lookup_index = index[i];
+ if (lookup_index < lookup_count)
+ properties[lookup_index] |= property;
+ }
return TT_Err_Ok;
}
@@ -6133,7 +6143,7 @@
{
FT_Error error, retError = TTO_Err_Not_Covered;
GPOS_Instance gpi;
- FT_UShort i, j, feature_index;
+ FT_UShort i, j, feature_index, lookup_count;
TTO_Feature feature;
if ( !face || !gpos ||
@@ -6146,6 +6156,8 @@
gpi.r2l = r2l;
gpi.dvi = dvi;
+ lookup_count = gpos->LookupList.LookupCount;
+
for ( i = 0; i < gpos->FeatureList.ApplyCount; i++ )
{
/* index of i'th feature */
@@ -6154,7 +6166,13 @@
for ( j = 0; j < feature.LookupListCount; j++ )
{
- error = Do_String_Lookup( &gpi, feature.LookupListIndex[j], buffer );
+ FT_UShort lookup_index = feature.LookupListIndex[j];
+
+ /* Skip nonexistant lookups */
+ if (lookup_index >= lookup_count)
+ continue;
+
+ error = Do_String_Lookup( &gpi, lookup_index, buffer );
if ( error )
{
if ( error != TTO_Err_Not_Covered )
diff --git a/pango/opentype/ftxgsub.c b/pango/opentype/ftxgsub.c
index 50101c58..6f085ccf 100644
--- a/pango/opentype/ftxgsub.c
+++ b/pango/opentype/ftxgsub.c
@@ -3939,8 +3939,8 @@
FT_UShort context_length,
int nesting_level )
{
- FT_Error error = TT_Err_Ok;
- FT_UShort i, flags;
+ FT_Error error = TTO_Err_Not_Covered;
+ FT_UShort i, flags, lookup_count;
TTO_Lookup* lo;
@@ -3949,6 +3949,10 @@
if ( nesting_level > TTO_MAX_NESTING_LEVEL )
return TTO_Err_Too_Many_Nested_Contexts;
+ lookup_count = gsub->LookupList.LookupCount;
+ if (lookup_index >= lookup_count)
+ return error;
+
lo = &gsub->LookupList.Lookup[lookup_index];
flags = lo->LookupFlag;
@@ -4056,8 +4060,9 @@
TTO_Feature feature;
FT_UInt* properties;
FT_UShort* index;
+ FT_UShort lookup_count;
- /* Each feature can only be added once once */
+ /* Each feature can only be added once */
if ( !gsub ||
feature_index >= gsub->FeatureList.FeatureCount ||
@@ -4070,9 +4075,14 @@
feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
index = feature.LookupListIndex;
+ lookup_count = gsub->LookupList.LookupCount;
for ( i = 0; i < feature.LookupListCount; i++ )
- properties[index[i]] |= property;
+ {
+ FT_UShort lookup_index = index[i];
+ if (lookup_index < lookup_count)
+ properties[lookup_index] |= property;
+ }
return TT_Err_Ok;
}
@@ -4120,13 +4130,15 @@
OTL_Buffer buffer )
{
FT_Error error, retError = TTO_Err_Not_Covered;
- FT_UShort i, j, feature_index;
+ FT_UShort i, j, feature_index, lookup_count;
TTO_Feature feature;
if ( !gsub ||
!buffer || buffer->in_length == 0 || buffer->in_pos >= buffer->in_length )
return TT_Err_Invalid_Argument;
+ lookup_count = gsub->LookupList.LookupCount;
+
for ( i = 0; i < gsub->FeatureList.ApplyCount; i++)
{
feature_index = gsub->FeatureList.ApplyOrder[i];
@@ -4134,7 +4146,13 @@
for ( j = 0; j < feature.LookupListCount; j++ )
{
- error = Do_String_Lookup( gsub, feature.LookupListIndex[j], buffer );
+ FT_UShort lookup_index = feature.LookupListIndex[j];
+
+ /* Skip nonexistant lookups */
+ if (lookup_index >= lookup_count)
+ continue;
+
+ error = Do_String_Lookup( gsub, lookup_index, buffer );
if ( error )
{
if ( error != TTO_Err_Not_Covered )