From a226462ead908102945bdbd612289c82c89ead5c Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 12 Jun 2010 22:13:39 +0000 Subject: Fix crash with a glyph that has a negative left or bottom border git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1238 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/pbmfont.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/pbmfont.h') diff --git a/lib/pbmfont.h b/lib/pbmfont.h index d287bc6c..a977a11f 100644 --- a/lib/pbmfont.h +++ b/lib/pbmfont.h @@ -16,15 +16,17 @@ struct glyph { unsigned int width; unsigned int height; /* The dimensions of the central glyph, i.e. the 'bmap' array */ - unsigned int x; + int x; /* Width in pixels of the white left border of this glyph. This can actually be negative to indicate that the central glyph backs up over the previous character in the line. In that case, if there is no previous character in the line, it is as if 'x' is 0. */ - unsigned int y; - /* Height in pixels of the white bottom border of this glyph */ + int y; + /* Height in pixels of the white bottom border of this glyph. + Can be negative. + */ unsigned int xadd; /* Width of glyph -- white left border plus central glyph plus white right border -- cgit 1.4.1