зеркало из https://github.com/mozilla/gecko-dev.git
bug 974575 - correction for bad commit (a0f556f37fb7016aa304b7cf0e811c0d38f0b969) ported from upstream. r=jrmuizel
This commit is contained in:
Родитель
3d7e176399
Коммит
543520fd62
|
@ -1151,14 +1151,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче