summaryrefslogtreecommitdiff
path: root/third_party/freetype/src/cid/cidparse.c
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2015-11-05 16:00:40 -0800
committerOliver Chang <ochang@chromium.org>2015-11-05 16:00:40 -0800
commitcec3f6878e37fcd1c6c15e0e2ab011931d55549e (patch)
treefb3a01b9b966e59f8851ea4438243b1813a951e7 /third_party/freetype/src/cid/cidparse.c
parentcca5b7684f48e2e933bf08ed573f7caca8e1d1ad (diff)
downloadpdfium-cec3f6878e37fcd1c6c15e0e2ab011931d55549e.tar.xz
Merge to XFA: Update bundled freetype to 2.6.1
Also adds a README.pdfium and 0000-include.patch that details the local modifications made. Also rolls testing/corpus to 45f88c6914fcac26ad930bb0ebbfa468c21db0a5 which includes regenerated corpus expectations. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1413673003 . (cherry picked from commit 87ee069d05ca06f60d6cfacd9e426739d8f2053d) Review URL: https://codereview.chromium.org/1416993005 .
Diffstat (limited to 'third_party/freetype/src/cid/cidparse.c')
-rw-r--r--third_party/freetype/src/cid/cidparse.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/third_party/freetype/src/cid/cidparse.c b/third_party/freetype/src/cid/cidparse.c
index d8476cdae8..c276949779 100644
--- a/third_party/freetype/src/cid/cidparse.c
+++ b/third_party/freetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (body). */
/* */
-/* Copyright 1996-2007, 2009, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -86,13 +86,13 @@
/* `StartData' or `/sfnts' */
{
FT_Byte buffer[256 + 10];
- FT_Long read_len = 256 + 10; /* same as signed FT_Stream->size */
+ FT_ULong read_len = 256 + 10;
FT_Byte* p = buffer;
for ( offset = FT_STREAM_POS(); ; offset += 256 )
{
- FT_Long stream_len; /* same as signed FT_Stream->size */
+ FT_ULong stream_len;
stream_len = stream->size - FT_STREAM_POS();
@@ -176,7 +176,18 @@
if ( cur[0] == 'S' && ft_strncmp( (char*)cur, "StartData", 9 ) == 0 )
{
if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
- parser->binary_length = ft_atol( (const char *)arg2 );
+ {
+ FT_Long tmp = ft_atol( (const char *)arg2 );
+
+
+ if ( tmp < 0 )
+ {
+ FT_ERROR(( "cid_parser_new: invalid length of hex data\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ }
+ else
+ parser->binary_length = (FT_ULong)tmp;
+ }
goto Exit;
}