[base] Fix thinko in previous commit. * src/base/ftbitmap.c (FT_Bitmap_Blend): Check final width, not target pitch. Problem reported by Sender Ghost <lightside@gmx.com>.
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
diff --git a/ChangeLog b/ChangeLog
index 78b82c9..92a2556 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-04-23 Werner Lemberg <wl@gnu.org>
+
+ [base] Fix thinko in previous commit.
+
+ * src/base/ftbitmap.c (FT_Bitmap_Blend): Check final width, not
+ target pitch.
+
+ Problem reported by Sender Ghost <lightside@gmx.com>.
+
2019-04-22 Werner Lemberg <wl@gnu.org>
* src/base/ftbitmap.c (FT_Bitmap_Blend): Check target pitch.
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 7e5e92d..0e0a76f 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -922,12 +922,18 @@
else
FT_TRACE5(( " target bitmap: empty\n" ));
- FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
- final_llx / 64, final_lly / 64,
- final_urx / 64, final_ury / 64,
- final_width, final_rows ));
+ if ( final_width && final_rows )
+ FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
+ final_llx / 64, final_lly / 64,
+ final_urx / 64, final_ury / 64,
+ final_width, final_rows ));
+ else
+ FT_TRACE5(( " final bitmap: empty\n" ));
#endif /* FT_DEBUG_LEVEL_TRACE */
+ if ( !( final_width && final_rows ) )
+ return FT_Err_Ok; /* nothing to do */
+
/* for blending, set offset vector of final bitmap */
/* temporarily to (0,0) */
source_llx -= final_llx;
@@ -971,12 +977,6 @@
pitch = target->pitch;
- if ( !pitch )
- {
- FT_TRACE5(( "FT_Blend_Bitmap:"
- " zero target bitmap pitch is invalid\n" ));
- return FT_THROW( Invalid_Argument );
- }
if ( pitch < 0 )
pitch = -pitch;