summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/lzw
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/lzw')
-rw-r--r--src/3rdparty/freetype/src/lzw/ftlzw.c16
-rw-r--r--src/3rdparty/freetype/src/lzw/ftzopen.c9
-rw-r--r--src/3rdparty/freetype/src/lzw/ftzopen.h4
3 files changed, 16 insertions, 13 deletions
diff --git a/src/3rdparty/freetype/src/lzw/ftlzw.c b/src/3rdparty/freetype/src/lzw/ftlzw.c
index a00bd5012f..6e57dedb97 100644
--- a/src/3rdparty/freetype/src/lzw/ftlzw.c
+++ b/src/3rdparty/freetype/src/lzw/ftlzw.c
@@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2004, 2005, 2006, 2009 by */
+/* Copyright 2004, 2005, 2006, 2009, 2010 by */
/* Albert Chin-A-Young. */
/* */
/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */
@@ -42,6 +42,10 @@
#ifdef FT_CONFIG_OPTION_USE_LZW
+#ifdef FT_CONFIG_OPTION_PIC
+#error "lzw code does not support PIC yet"
+#endif
+
#include "ftzopen.h"
@@ -118,13 +122,9 @@
zip->pos = 0;
/* check and skip .Z header */
- {
- stream = source;
-
- error = ft_lzw_check_header( source );
- if ( error )
- goto Exit;
- }
+ error = ft_lzw_check_header( source );
+ if ( error )
+ goto Exit;
/* initialize internal lzw variable */
ft_lzwstate_init( lzw, source );
diff --git a/src/3rdparty/freetype/src/lzw/ftzopen.c b/src/3rdparty/freetype/src/lzw/ftzopen.c
index fc7831510d..8bc65c8f57 100644
--- a/src/3rdparty/freetype/src/lzw/ftzopen.c
+++ b/src/3rdparty/freetype/src/lzw/ftzopen.c
@@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2005, 2006, 2007 by David Turner. */
+/* Copyright 2005, 2006, 2007, 2009 by David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -113,8 +113,8 @@
{
FT_Memory memory = state->memory;
FT_Error error;
- FT_UInt old_size = state->stack_size;
- FT_UInt new_size = old_size;
+ FT_Offset old_size = state->stack_size;
+ FT_Offset new_size = old_size;
new_size = new_size + ( new_size >> 1 ) + 4;
@@ -332,6 +332,9 @@
while ( code >= 256U )
{
+ if ( !state->prefix )
+ goto Eof;
+
FTLZW_STACK_PUSH( state->suffix[code - 256] );
code = state->prefix[code - 256];
}
diff --git a/src/3rdparty/freetype/src/lzw/ftzopen.h b/src/3rdparty/freetype/src/lzw/ftzopen.h
index dd602402ac..f7d2936be2 100644
--- a/src/3rdparty/freetype/src/lzw/ftzopen.h
+++ b/src/3rdparty/freetype/src/lzw/ftzopen.h
@@ -118,7 +118,7 @@
FT_Int buf_offset;
FT_Int buf_size;
FT_Bool buf_clear;
- FT_Int buf_total;
+ FT_Offset buf_total;
FT_UInt max_bits; /* max code bits, from file header */
FT_Int block_mode; /* block mode flag, from file header */
@@ -137,7 +137,7 @@
FT_Byte* stack; /* character stack */
FT_UInt stack_top;
- FT_UInt stack_size;
+ FT_Offset stack_size;
FT_Byte stack_0[FT_LZW_DEFAULT_STACK_SIZE]; /* minimize heap alloc */
FT_Stream source; /* source stream */