fixed a memory buffer overwrite bug. Damn !!

This commit is contained in:
David Turner 2007-04-06 08:19:04 +00:00
parent 9f83e05502
commit 1dcb4448c1
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-04-06 David Turner <david@freetype.org>
* src/base/ftbimap.c (ft_bitmap_assure_buffer): fixed buffer-overwrite bug
2007-04-04 Werner Lemberg <wl@gnu.org>
* Version 2.3.3 released.

View File

@ -149,15 +149,15 @@
if ( bit_last < bit_width )
{
FT_Byte* line = bitmap->buffer + ( bit_last >> 3 );
FT_Byte* end = bitmap->buffer + pitch;
FT_Int shift = bit_last & 7;
FT_UInt mask = 0xFF00U >> shift;
FT_Int count = height;
for ( ; count > 0; count--, line += pitch )
for ( ; count > 0; count--, line += pitch, end += pitch )
{
FT_Byte* write = line;
FT_Byte* end = line + pitch;
if ( shift > 0 )