Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: third_party/freetype/src/cff/cf2arrst.c

Issue 1413673003: Update bundled freetype to 2.6.1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: DEPS for corpus Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/freetype/src/cff/Jamfile ('k') | third_party/freetype/src/cff/cf2fixed.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /***************************************************************************/ 1 /***************************************************************************/
2 /* */ 2 /* */
3 /* cf2arrst.c */ 3 /* cf2arrst.c */
4 /* */ 4 /* */
5 /* Adobe's code for Array Stacks (body). */ 5 /* Adobe's code for Array Stacks (body). */
6 /* */ 6 /* */
7 /* Copyright 2007-2013 Adobe Systems Incorporated. */ 7 /* Copyright 2007-2013 Adobe Systems Incorporated. */
8 /* */ 8 /* */
9 /* This software, and all works of authorship, whether in source or */ 9 /* This software, and all works of authorship, whether in source or */
10 /* object code form as indicated by the copyright notice(s) included */ 10 /* object code form as indicated by the copyright notice(s) included */
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 static FT_Bool 94 static FT_Bool
95 cf2_arrstack_setNumElements( CF2_ArrStack arrstack, 95 cf2_arrstack_setNumElements( CF2_ArrStack arrstack,
96 size_t numElements ) 96 size_t numElements )
97 { 97 {
98 FT_ASSERT( arrstack != NULL ); 98 FT_ASSERT( arrstack != NULL );
99 99
100 { 100 {
101 FT_Error error = FT_Err_Ok; /* for FT_REALLOC */ 101 FT_Error error = FT_Err_Ok; /* for FT_REALLOC */
102 FT_Memory memory = arrstack->memory; /* for FT_REALLOC */ 102 FT_Memory memory = arrstack->memory; /* for FT_REALLOC */
103 103
104 FT_Long newSize = (FT_Long)( numElements * arrstack->sizeItem ); 104 size_t newSize = numElements * arrstack->sizeItem;
105 105
106 106
107 if ( numElements > LONG_MAX / arrstack->sizeItem ) 107 if ( numElements > FT_LONG_MAX / arrstack->sizeItem )
108 goto exit; 108 goto exit;
109 109
110 110
111 FT_ASSERT( newSize > 0 ); /* avoid realloc with zero size */ 111 FT_ASSERT( newSize > 0 ); /* avoid realloc with zero size */
112 112
113 if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) ) 113 if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
114 { 114 {
115 arrstack->allocated = numElements; 115 arrstack->allocated = numElements;
116 arrstack->totalSize = newSize; 116 arrstack->totalSize = newSize;
117 117
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void* newPtr = (FT_Byte*)arrstack->ptr + offset; 232 void* newPtr = (FT_Byte*)arrstack->ptr + offset;
233 233
234 234
235 FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem ); 235 FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );
236 arrstack->count += 1; 236 arrstack->count += 1;
237 } 237 }
238 } 238 }
239 239
240 240
241 /* END */ 241 /* END */
OLDNEW
« no previous file with comments | « third_party/freetype/src/cff/Jamfile ('k') | third_party/freetype/src/cff/cf2fixed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698