mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
bug 974575 - correction for bad commit (a0f556f37fb7016aa304b7cf0e811c0d38f0b969) ported from upstream. r=jrmuizel
This commit is contained in:
parent
d9227c7961
commit
2b7b569692
@ -1154,14 +1154,24 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
|
||||
} else {
|
||||
int i;
|
||||
unsigned char *source, *dest;
|
||||
int copy_len = MIN (stride, bitmap->pitch);
|
||||
int pad_len = stride - bitmap->pitch;
|
||||
|
||||
source = bitmap->buffer;
|
||||
dest = data;
|
||||
for (i = height; i; i--) {
|
||||
memcpy (dest, source, stride);
|
||||
memcpy (dest, source, copy_len);
|
||||
source += bitmap->pitch;
|
||||
dest += stride;
|
||||
}
|
||||
/* do we really care about zeroing any extra row padding in dest? */
|
||||
if (pad_len > 0) {
|
||||
dest = data + copy_len;
|
||||
for (i = height; i; i--) {
|
||||
memset (dest, '\0', pad_len);
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user