summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-07-27 02:19:39 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-07-27 02:19:39 +0000
commit00c6b89e6cf5627e25606bb0e3bc697469cc7775 (patch)
tree94c46cd5b2739006a83bf81b9af797bd57f5d896
parente4b67a36d29385c621f0d12ec1bd94221e96b0e5 (diff)
downloadpango-00c6b89e6cf5627e25606bb0e3bc697469cc7775.tar.gz
Fix return value to only contain TTO_Err_Not_Covered if *no* lookups
Sat Jul 26 22:12:46 2003 Owen Taylor <otaylor@redhat.com> * pango/opentype/ftxgsub.c (Do_String_Lookup, TT_GSUB_Apply_String): Fix return value to only contain TTO_Err_Not_Covered if *no* lookups matched. Fix memory leaks on error in Apply_String().
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-1-107
-rw-r--r--ChangeLog.pre-1-47
-rw-r--r--ChangeLog.pre-1-67
-rw-r--r--ChangeLog.pre-1-87
-rw-r--r--pango/opentype/ftxgsub.c120
6 files changed, 110 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index 45e5a278..a6748ca4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Jul 26 22:12:46 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c (Do_String_Lookup,
+ TT_GSUB_Apply_String): Fix return value to only
+ contain TTO_Err_Not_Covered if *no* lookups
+ matched. Fix memory leaks on error in Apply_String().
+
Sat Jul 26 22:09:44 2003 Owen Taylor <otaylor@redhat.com>
* modules/indic/indic-ot.c (indic_ot_reorder):
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 45e5a278..a6748ca4 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,10 @@
+Sat Jul 26 22:12:46 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c (Do_String_Lookup,
+ TT_GSUB_Apply_String): Fix return value to only
+ contain TTO_Err_Not_Covered if *no* lookups
+ matched. Fix memory leaks on error in Apply_String().
+
Sat Jul 26 22:09:44 2003 Owen Taylor <otaylor@redhat.com>
* modules/indic/indic-ot.c (indic_ot_reorder):
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index 45e5a278..a6748ca4 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,10 @@
+Sat Jul 26 22:12:46 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c (Do_String_Lookup,
+ TT_GSUB_Apply_String): Fix return value to only
+ contain TTO_Err_Not_Covered if *no* lookups
+ matched. Fix memory leaks on error in Apply_String().
+
Sat Jul 26 22:09:44 2003 Owen Taylor <otaylor@redhat.com>
* modules/indic/indic-ot.c (indic_ot_reorder):
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 45e5a278..a6748ca4 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,10 @@
+Sat Jul 26 22:12:46 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c (Do_String_Lookup,
+ TT_GSUB_Apply_String): Fix return value to only
+ contain TTO_Err_Not_Covered if *no* lookups
+ matched. Fix memory leaks on error in Apply_String().
+
Sat Jul 26 22:09:44 2003 Owen Taylor <otaylor@redhat.com>
* modules/indic/indic-ot.c (indic_ot_reorder):
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 45e5a278..a6748ca4 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,10 @@
+Sat Jul 26 22:12:46 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/ftxgsub.c (Do_String_Lookup,
+ TT_GSUB_Apply_String): Fix return value to only
+ contain TTO_Err_Not_Covered if *no* lookups
+ matched. Fix memory leaks on error in Apply_String().
+
Sat Jul 26 22:09:44 2003 Owen Taylor <otaylor@redhat.com>
* modules/indic/indic-ot.c (indic_ot_reorder):
diff --git a/pango/opentype/ftxgsub.c b/pango/opentype/ftxgsub.c
index ff42dc6a..e9b5548a 100644
--- a/pango/opentype/ftxgsub.c
+++ b/pango/opentype/ftxgsub.c
@@ -4303,7 +4303,7 @@
TTO_GSUB_String* in,
TTO_GSUB_String* out )
{
- FT_Error error = TTO_Err_Not_Covered;
+ FT_Error error, retError = TTO_Err_Not_Covered;
FT_UShort* properties = gsub->LookupList.Properties;
FT_UShort* p_in = in->properties;
@@ -4319,8 +4319,13 @@
/* 0xFFFF indicates that we don't have a context length yet */
error = Do_Glyph_Lookup( gsub, lookup_index, in, out,
0xFFFF, nesting_level );
- if ( error && error != TTO_Err_Not_Covered )
- return error;
+ if ( error )
+ {
+ if ( error != TTO_Err_Not_Covered )
+ return error;
+ }
+ else
+ retError = error;
}
else
error = TTO_Err_Not_Covered;
@@ -4330,7 +4335,7 @@
return error;
}
- return error;
+ return retError;
}
@@ -4473,7 +4478,7 @@
TTO_GSUB_String* in,
TTO_GSUB_String* out )
{
- FT_Error error = TTO_Err_Not_Covered;
+ FT_Error error, retError = TTO_Err_Not_Covered;
FT_Memory memory = in->memory;
FT_UShort j;
@@ -4492,11 +4497,28 @@
properties = gsub->LookupList.Properties;
- tmp1.memory = memory;
- tmp1.length = in->length;
- tmp1.allocated = in->length;
- tmp1.pos = in->pos;
- tmp1.max_ligID = 1;
+ tmp1.memory = memory;
+ tmp1.length = in->length;
+ tmp1.allocated = in->length;
+ tmp1.pos = in->pos;
+ tmp1.max_ligID = 1;
+ tmp1.string = NULL;
+ tmp1.properties = NULL;
+ tmp1.components = NULL;
+ tmp1.ligIDs = NULL;
+ tmp1.logClusters = NULL;
+
+ tmp2.memory = memory;
+ tmp2.allocated = 0;
+ tmp2.pos = 0;
+ tmp2.string = NULL;
+ tmp2.properties = NULL;
+ tmp2.components = NULL;
+ tmp2.ligIDs = NULL;
+ tmp2.logClusters = NULL;
+
+ ptmp1 = &tmp1;
+ ptmp2 = &tmp2;
if ( ALLOC_ARRAY( tmp1.string, tmp1.length, FT_UShort ) )
return error;
@@ -4506,37 +4528,31 @@
`ligIDs' array in the string object */
if ( ALLOC_ARRAY( tmp1.components, tmp1.length, FT_UShort ) )
- return error;
+ goto End;
if ( ALLOC_ARRAY( tmp1.ligIDs, tmp1.length, FT_UShort ) )
- return error;
+ goto End;
if ( ALLOC_ARRAY( tmp1.properties, tmp1.length, FT_UShort ) )
- return error;
+ goto End;
if ( in->properties )
MEM_Copy( tmp1.properties, in->properties,
in->length * sizeof( FT_UShort ) );
if ( ALLOC_ARRAY( tmp1.logClusters, tmp1.length, FT_Int ) )
- return error;
+ goto End;
MEM_Copy( tmp1.logClusters, in->logClusters,
in->length * sizeof( FT_Int ) );
- tmp2.memory = memory;
- tmp2.allocated = 0;
- tmp2.pos = 0;
- tmp2.string = NULL;
- tmp2.properties = NULL;
- tmp2.components = NULL;
- tmp2.ligIDs = NULL;
- tmp2.logClusters = NULL;
-
- ptmp1 = &tmp1;
- ptmp2 = &tmp2;
-
for ( j = 0; j < gsub->LookupList.LookupCount; j++ )
if ( properties[j] )
{
error = Do_String_Lookup( gsub, j, ptmp1, ptmp2 );
- if ( error && error != TTO_Err_Not_Covered )
- return error;
+ if ( error )
+ {
+ if ( error != TTO_Err_Not_Covered )
+ goto End;
+ }
+ else
+ retError = error;
+
/* flipping `in' and `out', preparing the next loop */
@@ -4550,29 +4566,43 @@
ptmp1 = t;
}
- out->length = ptmp1->length;
- out->pos = 0;
- out->allocated = ptmp1->allocated;
- out->string = ptmp1->string;
- out->components = ptmp1->components;
- out->ligIDs = ptmp1->ligIDs;
- out->logClusters = ptmp1->logClusters;
-
- if ( in->properties )
- out->properties = ptmp1->properties;
- else
- {
- FREE( ptmp1->properties );
- out->properties = NULL;
- }
-
+ End:
FREE( ptmp2->string );
FREE( ptmp2->properties );
FREE( ptmp2->components );
FREE( ptmp2->ligIDs );
FREE( ptmp2->logClusters );
- return error;
+ if ( error && error != TTO_Err_Not_Covered )
+ {
+ FREE( ptmp1->string );
+ FREE( ptmp1->components );
+ FREE( ptmp1->ligIDs );
+ FREE( ptmp1->properties );
+ FREE( ptmp1->logClusters );
+
+ return error;
+ }
+ else
+ {
+ out->length = ptmp1->length;
+ out->pos = 0;
+ out->allocated = ptmp1->allocated;
+ out->string = ptmp1->string;
+ out->components = ptmp1->components;
+ out->ligIDs = ptmp1->ligIDs;
+ out->logClusters = ptmp1->logClusters;
+
+ if ( in->properties )
+ out->properties = ptmp1->properties;
+ else
+ {
+ FREE( ptmp1->properties );
+ out->properties = NULL;
+ }
+
+ return retError;
+ }
}