Revert "[base] Fix bitmap copying where the new pitch is smaller."
This reverts commit c0f1adedcf
.
This commit is contained in:
parent
c0f1adedcf
commit
c2e2a8e5d9
|
@ -1,9 +1,3 @@
|
|||
2018-04-22 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[base] Fix bitmap copying where the new pitch is smaller.
|
||||
|
||||
* src/base/ftbitmap.c (ft_bitmap_assure_buffer): Handle it.
|
||||
|
||||
2018-04-22 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Another fix for handling invalid format 2 cmaps.
|
||||
|
|
|
@ -237,38 +237,23 @@
|
|||
unsigned char* out = buffer;
|
||||
|
||||
unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
|
||||
unsigned int delta = new_pitch - pitch;
|
||||
|
||||
|
||||
FT_MEM_ZERO( out, new_pitch * ypixels );
|
||||
out += new_pitch * ypixels;
|
||||
|
||||
if ( new_pitch > pitch )
|
||||
{
|
||||
unsigned int delta = new_pitch - pitch;
|
||||
|
||||
|
||||
while ( in < limit )
|
||||
{
|
||||
FT_MEM_COPY( out, in, len );
|
||||
in += pitch;
|
||||
out += pitch;
|
||||
|
||||
/* we have to zero out the new (unused) pitch bytes */
|
||||
FT_MEM_ZERO( out, delta );
|
||||
out += delta;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while ( in < limit )
|
||||
{
|
||||
FT_MEM_COPY( out, in, len );
|
||||
in += pitch;
|
||||
out += new_pitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FT_UInt len = ( width * bpp + 7 ) >> 3;
|
||||
|
||||
|
@ -276,10 +261,6 @@
|
|||
unsigned char* out = buffer;
|
||||
|
||||
unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
|
||||
|
||||
|
||||
if ( new_pitch > pitch )
|
||||
{
|
||||
unsigned int delta = new_pitch - pitch;
|
||||
|
||||
|
||||
|
@ -289,20 +270,9 @@
|
|||
in += pitch;
|
||||
out += pitch;
|
||||
|
||||
/* we have to zero out the new (unused) pitch bytes */
|
||||
FT_MEM_ZERO( out, delta );
|
||||
out += delta;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while ( in < limit )
|
||||
{
|
||||
FT_MEM_COPY( out, in, len );
|
||||
in += pitch;
|
||||
out += new_pitch;
|
||||
}
|
||||
}
|
||||
|
||||
FT_MEM_ZERO( out, new_pitch * ypixels );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue