From 462f18c7b25fe3e467f837647d07ab0a78aa8d2b Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 22 Feb 2015 21:39:56 +0100 Subject: Merged origin/release (checked in because wanted to merge new stuff) --- freetype/src/bzip2/ftbzip2.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'freetype/src/bzip2/ftbzip2.c') diff --git a/freetype/src/bzip2/ftbzip2.c b/freetype/src/bzip2/ftbzip2.c index 749413027..7e406b161 100644 --- a/freetype/src/bzip2/ftbzip2.c +++ b/freetype/src/bzip2/ftbzip2.c @@ -8,7 +8,7 @@ /* parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2010, 2012, 2013 by */ +/* Copyright 2010, 2012-2014 by */ /* Joel Klinghed. */ /* */ /* Based on src/gzip/ftgzip.c, Copyright 2002 - 2010 by */ @@ -131,7 +131,7 @@ /* head[0] && head[1] are the magic numbers; */ /* head[2] is the version, and head[3] the blocksize */ if ( head[0] != 0x42 || - head[1] != 0x5a || + head[1] != 0x5A || head[2] != 0x68 ) /* only support bzip2 (huffman) */ { error = FT_THROW( Invalid_File_Format ); @@ -456,10 +456,18 @@ FT_Stream source ) { FT_Error error; - FT_Memory memory = source->memory; + FT_Memory memory; FT_BZip2File zip = NULL; + if ( !stream || !source ) + { + error = FT_THROW( Invalid_Stream_Handle ); + goto Exit; + } + + memory = source->memory; + /* * check the header right now; this prevents allocating unnecessary * objects when we don't need them -- cgit v1.2.3