Fix runtime errors found by clang's sanitizer (#47082).
* src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Copy), src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Properly handle empty input buffer.
This commit is contained in:
parent
4c00dfb458
commit
0d053bac84
|
@ -1,3 +1,11 @@
|
||||||
|
2016-02-07 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
Fix runtime errors found by clang's sanitizer (#47082).
|
||||||
|
|
||||||
|
* src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c
|
||||||
|
(FT_Outline_Copy), src/cache/ftcsbits.c (ftc_sbit_copy_bitmap):
|
||||||
|
Properly handle empty input buffer.
|
||||||
|
|
||||||
2016-02-07 Werner Lemberg <wl@gnu.org>
|
2016-02-07 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[cff] Minor.
|
[cff] Minor.
|
||||||
|
|
|
@ -4201,6 +4201,7 @@
|
||||||
|
|
||||||
|
|
||||||
MD5_Init( &ctx );
|
MD5_Init( &ctx );
|
||||||
|
if ( bitmap.buffer )
|
||||||
MD5_Update( &ctx, bitmap.buffer, rows * pitch );
|
MD5_Update( &ctx, bitmap.buffer, rows * pitch );
|
||||||
MD5_Final( md5, &ctx );
|
MD5_Final( md5, &ctx );
|
||||||
|
|
||||||
|
|
|
@ -415,10 +415,13 @@
|
||||||
if ( source == target )
|
if ( source == target )
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
|
|
||||||
|
if ( source->n_points )
|
||||||
|
{
|
||||||
FT_ARRAY_COPY( target->points, source->points, source->n_points );
|
FT_ARRAY_COPY( target->points, source->points, source->n_points );
|
||||||
|
|
||||||
FT_ARRAY_COPY( target->tags, source->tags, source->n_points );
|
FT_ARRAY_COPY( target->tags, source->tags, source->n_points );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( source->n_contours )
|
||||||
FT_ARRAY_COPY( target->contours, source->contours, source->n_contours );
|
FT_ARRAY_COPY( target->contours, source->contours, source->n_contours );
|
||||||
|
|
||||||
/* copy all flags, except the `FT_OUTLINE_OWNER' one */
|
/* copy all flags, except the `FT_OUTLINE_OWNER' one */
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
pitch = -pitch;
|
pitch = -pitch;
|
||||||
|
|
||||||
size = (FT_ULong)pitch * bitmap->rows;
|
size = (FT_ULong)pitch * bitmap->rows;
|
||||||
|
if ( !size )
|
||||||
|
return FT_Err_Ok;
|
||||||
|
|
||||||
if ( !FT_ALLOC( sbit->buffer, size ) )
|
if ( !FT_ALLOC( sbit->buffer, size ) )
|
||||||
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
|
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
|
||||||
|
|
Loading…
Reference in New Issue