[base] Fix bitmap emboldening. Bug introduced after release 2.8. * src/base/ftbitmap.c (ft_bitmap_assure_buffer): We use `FT_QALLOC_MULT', which doesn't zero out the buffer. Adjust the bitmap copying code to take care of this fact.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
diff --git a/ChangeLog b/ChangeLog
index 4dc8c55..24acb8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-04-22 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [base] Fix bitmap emboldening.
+
+ Bug introduced after release 2.8.
+
+ * src/base/ftbitmap.c (ft_bitmap_assure_buffer): We use
+ `FT_QALLOC_MULT', which doesn't zero out the buffer. Adjust the
+ bitmap copying code to take care of this fact.
+
2018-04-22 Werner Lemberg <wl@gnu.org>
Another fix for handling invalid format 2 cmaps.
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 93efb09..a974666 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -237,7 +237,7 @@
unsigned char* out = buffer;
unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
- unsigned int delta = new_pitch - pitch;
+ unsigned int delta = new_pitch - len;
FT_MEM_ZERO( out, new_pitch * ypixels );
@@ -247,8 +247,10 @@
{
FT_MEM_COPY( out, in, len );
in += pitch;
- out += pitch;
+ out += len;
+ /* we use FT_QALLOC_MULT, which doesn't zero out the buffer; */
+ /* consequently, we have to manually zero out the remaining bytes */
FT_MEM_ZERO( out, delta );
out += delta;
}
@@ -261,14 +263,14 @@
unsigned char* out = buffer;
unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
- unsigned int delta = new_pitch - pitch;
+ unsigned int delta = new_pitch - len;
while ( in < limit )
{
FT_MEM_COPY( out, in, len );
in += pitch;
- out += pitch;
+ out += len;
FT_MEM_ZERO( out, delta );
out += delta;