forked from minhngoc25a/freetype2
Revert "Performs basic checks to see if SVG data is valid or not."
This reverts commit e5dc1b65cdc7ea357118fddbdb4b00afc403f81c. These aren't necessary.
This commit is contained in:
parent
0e8e132bd7
commit
398801e2c0
|
@ -35,24 +35,6 @@
|
||||||
|
|
||||||
#include "ttsvg.h"
|
#include "ttsvg.h"
|
||||||
|
|
||||||
/* SVG table looks like:
|
|
||||||
* --------------------------------------
|
|
||||||
* Bytes: Field |
|
|
||||||
* --------------------------------------
|
|
||||||
* 2 version
|
|
||||||
* 4 offsetToSVGDocumentList
|
|
||||||
* 4 reserved
|
|
||||||
* 2 numEntries (non-zero)
|
|
||||||
* 12*numEntries documentList
|
|
||||||
*
|
|
||||||
* Since numEntries must be at least one, minimum
|
|
||||||
* size of SVG table is 24. Everything apart from
|
|
||||||
* the documentList makes 12 bytes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SVG_HEADER_BASE_SIZE 12
|
|
||||||
#define SVG_HEADER_MIN_SIZE 24
|
|
||||||
|
|
||||||
/* TODO: (OT-SVG) Decide whether to add documentation here or not */
|
/* TODO: (OT-SVG) Decide whether to add documentation here or not */
|
||||||
|
|
||||||
typedef struct Svg_
|
typedef struct Svg_
|
||||||
|
@ -87,9 +69,6 @@
|
||||||
if( error )
|
if( error )
|
||||||
goto NoSVG;
|
goto NoSVG;
|
||||||
|
|
||||||
if ( table_size < SVG_HEADER_MIN_SIZE )
|
|
||||||
goto InvalidTable;
|
|
||||||
|
|
||||||
if( FT_FRAME_EXTRACT( table_size, table ))
|
if( FT_FRAME_EXTRACT( table_size, table ))
|
||||||
goto NoSVG;
|
goto NoSVG;
|
||||||
|
|
||||||
|
@ -98,14 +77,7 @@
|
||||||
goto NoSVG;
|
goto NoSVG;
|
||||||
|
|
||||||
p = table;
|
p = table;
|
||||||
svg->version = FT_NEXT_USHORT( p );
|
svg->version = FT_NEXT_USHORT( p );
|
||||||
|
|
||||||
/* At the time of writing this, only version 0 exists,
|
|
||||||
* and only that is supported by FreeType
|
|
||||||
*/
|
|
||||||
if ( svg->version != 0 )
|
|
||||||
goto InvalidTable;
|
|
||||||
|
|
||||||
offsetToSVGDocumentList = FT_NEXT_ULONG( p );
|
offsetToSVGDocumentList = FT_NEXT_ULONG( p );
|
||||||
|
|
||||||
if( offsetToSVGDocumentList == 0 )
|
if( offsetToSVGDocumentList == 0 )
|
||||||
|
@ -116,9 +88,6 @@
|
||||||
p = svg->svg_doc_list;
|
p = svg->svg_doc_list;
|
||||||
svg->num_entries = FT_NEXT_USHORT( p );
|
svg->num_entries = FT_NEXT_USHORT( p );
|
||||||
|
|
||||||
if ( ( svg->num_entries*12 + SVG_HEADER_BASE_SIZE ) > table_size )
|
|
||||||
goto InvalidTable;
|
|
||||||
|
|
||||||
FT_TRACE3(( "version: %d\n", svg->version ));
|
FT_TRACE3(( "version: %d\n", svg->version ));
|
||||||
FT_TRACE3(( "num entiries: %d\n", svg->num_entries ));
|
FT_TRACE3(( "num entiries: %d\n", svg->num_entries ));
|
||||||
|
|
||||||
|
@ -275,10 +244,7 @@
|
||||||
*doc_length = mid_doc.length;
|
*doc_length = mid_doc.length;
|
||||||
*start_glyph = mid_doc.start_glyph_id;
|
*start_glyph = mid_doc.start_glyph_id;
|
||||||
*end_glyph = mid_doc.end_glyph_id;
|
*end_glyph = mid_doc.end_glyph_id;
|
||||||
if ( *doc_length == 0 )
|
error = FT_Err_Ok;
|
||||||
error = FT_THROW( Invalid_SVG_Document );
|
|
||||||
else
|
|
||||||
error = FT_Err_Ok;
|
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue