提交 ef074810 编写于 作者: O Owen Taylor 提交者: Owen Taylor

Free buffer->positions, clean up error returns that were returning

Thu May 27 16:57:30 2004  Owen Taylor  <otaylor@redhat.com>

        * pango/opentype/otlbuffer.c: Free buffer->positions,
        clean up error returns that were returning uninitialized
        values. (#139239, Behdad Esfahbod)
上级 de568e7e
...@@ -28,12 +28,15 @@ ...@@ -28,12 +28,15 @@
while (size > new_allocated) while (size > new_allocated)
new_allocated += (new_allocated >> 1) + 8; new_allocated += (new_allocated >> 1) + 8;
if ( FT_REALLOC_ARRAY( buffer->in_string, buffer->allocated, new_allocated, OTL_GlyphItemRec ) ) error = FT_REALLOC_ARRAY( buffer->in_string, buffer->allocated, new_allocated, OTL_GlyphItemRec );
if ( error )
return error; return error;
if ( FT_REALLOC_ARRAY( buffer->out_string, buffer->allocated, new_allocated, OTL_GlyphItemRec ) ) error = FT_REALLOC_ARRAY( buffer->out_string, buffer->allocated, new_allocated, OTL_GlyphItemRec );
if ( error )
return error; return error;
if ( FT_REALLOC_ARRAY( buffer->positions, buffer->allocated, new_allocated, OTL_PositionRec ) ) error = FT_REALLOC_ARRAY( buffer->positions, buffer->allocated, new_allocated, OTL_PositionRec );
if ( error )
return error; return error;
buffer->allocated = new_allocated; buffer->allocated = new_allocated;
...@@ -47,8 +50,9 @@ ...@@ -47,8 +50,9 @@
OTL_Buffer *buffer ) OTL_Buffer *buffer )
{ {
FT_Error error; FT_Error error;
if ( FT_ALLOC( *buffer, sizeof( OTL_BufferRec ) ) ) error = FT_ALLOC( *buffer, sizeof( OTL_BufferRec ) );
if ( error )
return error; return error;
(*buffer)->memory = memory; (*buffer)->memory = memory;
...@@ -91,6 +95,7 @@ ...@@ -91,6 +95,7 @@
FT_FREE( buffer->in_string ); FT_FREE( buffer->in_string );
FT_FREE( buffer->out_string ); FT_FREE( buffer->out_string );
FT_FREE( buffer->positions );
FT_FREE( buffer ); FT_FREE( buffer );
return FT_Err_Ok; return FT_Err_Ok;
...@@ -117,7 +122,7 @@ ...@@ -117,7 +122,7 @@
OTL_GlyphItem glyph; OTL_GlyphItem glyph;
error = otl_buffer_ensure( buffer, buffer->in_length + 1 ); error = otl_buffer_ensure( buffer, buffer->in_length + 1 );
if ( error != FT_Err_Ok ) if ( error )
return error; return error;
glyph = &buffer->in_string[buffer->in_length]; glyph = &buffer->in_string[buffer->in_length];
...@@ -165,7 +170,7 @@ ...@@ -165,7 +170,7 @@
FT_UInt cluster; FT_UInt cluster;
error = otl_buffer_ensure( buffer, buffer->out_pos + num_out ); error = otl_buffer_ensure( buffer, buffer->out_pos + num_out );
if ( error != FT_Err_Ok ) if ( error )
return error; return error;
properties = buffer->in_string[buffer->in_pos].properties; properties = buffer->in_string[buffer->in_pos].properties;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册