summaryrefslogtreecommitdiff
path: root/src/smooth/ftsmooth.c
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-08-01 00:32:06 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-08-01 00:32:06 +0900
commite866cf3f5537cfb03cfb87e3e607f13f41f5d299 (patch)
tree85403a4e060f02a9b9645eecc8cf0bd7ac270be3 /src/smooth/ftsmooth.c
parentd3ed6d1bba27aaae4774db957a82caa6d5b67632 (diff)
Improve bitmap size or pixel variables for 16-bit systems.
Diffstat (limited to 'src/smooth/ftsmooth.c')
-rw-r--r--src/smooth/ftsmooth.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index a47c97a2..3d3d30ab 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -321,12 +321,19 @@
FT_Outline_Translate( outline, x_shift, y_shift );
+ /*
+ * XXX: on 16bit system, we return an error for huge bitmap
+ * to prevent an overflow.
+ */
+ if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX )
+ return Smooth_Err_Invalid_Pixel_Size;
+
if ( error )
goto Exit;
slot->format = FT_GLYPH_FORMAT_BITMAP;
- slot->bitmap_left = x_left;
- slot->bitmap_top = y_top;
+ slot->bitmap_left = (FT_Int)x_left;
+ slot->bitmap_top = (FT_Int)y_top;
Exit:
if ( outline && origin )