Fix acess outside of a loaded frame and some memory leaks on failure.
Fri May 10 14:41:27 2002 Owen Taylor <otaylor@redhat.com> * pango/opentype/ftxgdef.c (TT_Load_GDEF_Table): Fix acess outside of a loaded frame and some memory leaks on failure.
This commit is contained in:
parent
a63dbbbeeb
commit
9df9af0b36
|
@ -187,7 +187,7 @@
|
||||||
gdef->GlyphClassDef.loaded = FALSE;
|
gdef->GlyphClassDef.loaded = FALSE;
|
||||||
|
|
||||||
if ( ACCESS_Frame( 2L ) )
|
if ( ACCESS_Frame( 2L ) )
|
||||||
goto Fail0;
|
goto Fail1;
|
||||||
|
|
||||||
new_offset = GET_UShort();
|
new_offset = GET_UShort();
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
gdef->AttachList.loaded = FALSE;
|
gdef->AttachList.loaded = FALSE;
|
||||||
|
|
||||||
if ( ACCESS_Frame( 2L ) )
|
if ( ACCESS_Frame( 2L ) )
|
||||||
return error;
|
goto Fail2;
|
||||||
|
|
||||||
new_offset = GET_UShort();
|
new_offset = GET_UShort();
|
||||||
|
|
||||||
|
@ -232,8 +232,13 @@
|
||||||
first have to scan the LookupFlag values to find out whether we
|
first have to scan the LookupFlag values to find out whether we
|
||||||
must load it or not. Here we only store the offset of the table. */
|
must load it or not. Here we only store the offset of the table. */
|
||||||
|
|
||||||
|
if ( ACCESS_Frame( 2L ) )
|
||||||
|
goto Fail3;
|
||||||
|
|
||||||
new_offset = GET_UShort();
|
new_offset = GET_UShort();
|
||||||
|
|
||||||
|
FORGET_Frame();
|
||||||
|
|
||||||
if ( new_offset )
|
if ( new_offset )
|
||||||
gdef->MarkAttachClassDef_offset = new_offset + base_offset;
|
gdef->MarkAttachClassDef_offset = new_offset + base_offset;
|
||||||
else
|
else
|
||||||
|
@ -248,6 +253,9 @@
|
||||||
|
|
||||||
return TT_Err_Ok;
|
return TT_Err_Ok;
|
||||||
|
|
||||||
|
Fail3:
|
||||||
|
Free_LigCaretList( &gdef->LigCaretList, memory );
|
||||||
|
|
||||||
Fail2:
|
Fail2:
|
||||||
Free_AttachList( &gdef->AttachList, memory );
|
Free_AttachList( &gdef->AttachList, memory );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue