shithub: freetype+ttf2subf

Download patch

ref: 82365c0dead99dd119d9e7117cf4f36ce1d1cbe1
parent: 0b1c0c6b20bf121096afff206d570f26183402b3
author: Werner Lemberg <[email protected]>
date: Sat Feb 25 08:22:40 EST 2012

[type42] Fix Savannah bug #35602.

* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
thoroughly.

git/fs: mount .git/fs: mount/attach disallowed
binary files a/ChangeLog b/ChangeLog differ
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 font parser (body).                                          */
 /*                                                                         */
-/*  Copyright 2002-2011 by                                                 */
+/*  Copyright 2002-2012 by                                                 */
 /*  Roberto Alameda.                                                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -608,7 +608,8 @@
       }
 
       /* A string can have a trailing zero byte for padding.  Ignore it. */
-      if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) )
+      if ( string_size                                                  &&
+           string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) )
         string_size--;
 
       if ( !string_size )