summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/lzw/ftlzw.c
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-03-19 17:34:42 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-03-20 13:42:29 +0000
commit2eaf0cf8fd6e7c290497fedb08134a89e7b49b1d (patch)
tree0a4f7bf528e87d0b0a71ce7fccf702b87f4cdec1 /src/3rdparty/freetype/src/lzw/ftlzw.c
parent77c518a50334d4dcf2476a4f39edc1e3990c7f0b (diff)
Update bundled FreeType to 2.5.5
Removed everything, imported with help of import_from_tarball.sh script, and then added a pre-generated builds/unix/ftconfig.h Task-number: QTBUG-44648 Change-Id: Iea948e41f7761f1580382b3763d04c7a61383382 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/lzw/ftlzw.c')
-rw-r--r--src/3rdparty/freetype/src/lzw/ftlzw.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/3rdparty/freetype/src/lzw/ftlzw.c b/src/3rdparty/freetype/src/lzw/ftlzw.c
index 6e57dedb97..e1b3564a5f 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, 2010 by */
+/* Copyright 2004-2006, 2009, 2010, 2012-2014 by */
/* Albert Chin-A-Young. */
/* */
/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */
@@ -34,6 +34,7 @@
#undef __FTERRORS_H__
+#undef FT_ERR_PREFIX
#define FT_ERR_PREFIX LZW_Err_
#define FT_ERR_BASE FT_Mod_Err_LZW
@@ -44,7 +45,7 @@
#ifdef FT_CONFIG_OPTION_PIC
#error "lzw code does not support PIC yet"
-#endif
+#endif
#include "ftzopen.h"
@@ -95,9 +96,9 @@
goto Exit;
/* head[0] && head[1] are the magic numbers */
- if ( head[0] != 0x1f ||
- head[1] != 0x9d )
- error = LZW_Err_Invalid_File_Format;
+ if ( head[0] != 0x1F ||
+ head[1] != 0x9D )
+ error = FT_THROW( Invalid_File_Format );
Exit:
return error;
@@ -110,7 +111,7 @@
FT_Stream source )
{
FT_LzwState lzw = &zip->lzw;
- FT_Error error = LZW_Err_Ok;
+ FT_Error error;
zip->stream = stream;
@@ -171,7 +172,7 @@
{
FT_LzwState lzw = &zip->lzw;
FT_ULong count;
- FT_Error error = 0;
+ FT_Error error = FT_Err_Ok;
zip->cursor = zip->buffer;
@@ -181,7 +182,7 @@
zip->limit = zip->cursor + count;
if ( count == 0 )
- error = LZW_Err_Invalid_Stream_Operation;
+ error = FT_THROW( Invalid_Stream_Operation );
return error;
}
@@ -192,7 +193,7 @@
ft_lzw_file_skip_output( FT_LZWFile zip,
FT_ULong count )
{
- FT_Error error = LZW_Err_Ok;
+ FT_Error error = FT_Err_Ok;
/* first, we skip what we can from the output buffer */
@@ -223,7 +224,7 @@
if ( numread < delta )
{
/* not enough bytes */
- error = LZW_Err_Invalid_Stream_Operation;
+ error = FT_THROW( Invalid_Stream_Operation );
break;
}
@@ -348,10 +349,18 @@
FT_Stream source )
{
FT_Error error;
- FT_Memory memory = source->memory;
- FT_LZWFile zip;
+ FT_Memory memory;
+ FT_LZWFile zip = NULL;
+ if ( !stream || !source )
+ {
+ error = FT_THROW( Invalid_Stream_Handle );
+ goto Exit;
+ }
+
+ memory = source->memory;
+
/*
* Check the header right now; this prevents allocation of a huge
* LZWFile object (400 KByte of heap memory) if not necessary.
@@ -402,7 +411,7 @@
FT_UNUSED( stream );
FT_UNUSED( source );
- return LZW_Err_Unimplemented_Feature;
+ return FT_THROW( Unimplemented_Feature );
}