From 8b1c34da4ca2f21713b4a47db2a025c23e5b9eb4 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 24 Jun 2010 08:48:10 +0200 Subject: [PATCH] Fix Savannah bug #30236. * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer to `cmap_table'. --- ChangeLog | 7 +++++++ src/sfnt/ttcmap.c | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3132d3935..8d320b449 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-06-24 Werner Lemberg + + Fix Savannah bug #30236. + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer + to `cmap_table'. + 2010-06-24 Werner Lemberg Fix Savannah bug #30235. diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 7fa2793b7..99e7dec5a 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -4,7 +4,7 @@ /* */ /* TrueType character mapping table (cmap) support (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -3392,11 +3392,12 @@ FT_Byte* limit = table + face->cmap_size; FT_UInt volatile num_cmaps; FT_Byte* volatile p = table; - FT_Library library = FT_FACE_LIBRARY(face); - FT_UNUSED(library); + FT_Library library = FT_FACE_LIBRARY( face ); + + FT_UNUSED( library ); - if ( p + 4 > limit ) + if ( !p || p + 4 > limit ) return SFNT_Err_Invalid_Table; /* only recognize format 0 */