idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
8,000
Render_Text( int first_glyph ) { FT_F26Dot6 start_x, start_y, step_x, step_y, x, y; int i; const unsigned char* p; start_x = 4; start_y = 32 + size->metrics.y_ppem; step_x = size->metrics.x_ppem + 4; step_y = size->metrics.y_ppem + 10; x = start_x; y = start_y; i = first_glyph; p = Text; while ( i > 0 && *p ) { p++; i--; } while ( *p ) { if ( !( error = LoadChar( FT_Get_Char_Index( face, (unsigned char)*p ), hinted ) ) ) { #ifdef DEBUG if ( i <= first_glyph + 6 ) { LOG(( "metrics[%02d] = [%x %x]\n", i, glyph->metrics.horiBearingX, glyph->metrics.horiAdvance )); if ( i == first_glyph + 6 ) LOG(( "-------------------------\n" )); } #endif Render_Glyph( x, y ); x += ( glyph->metrics.horiAdvance >> 6 ) + 1; if ( x + size->metrics.x_ppem > bit.width ) { x = start_x; y += step_y; if ( y >= bit.rows ) return FT_Err_Ok; } } else Fail++; i++; p++; } return FT_Err_Ok; }
DoS Exec Code Overflow
0
Render_Text( int first_glyph ) { FT_F26Dot6 start_x, start_y, step_x, step_y, x, y; int i; const unsigned char* p; start_x = 4; start_y = 32 + size->metrics.y_ppem; step_x = size->metrics.x_ppem + 4; step_y = size->metrics.y_ppem + 10; x = start_x; y = start_y; i = first_glyph; p = Text; while ( i > 0 && *p ) { p++; i--; } while ( *p ) { if ( !( error = LoadChar( FT_Get_Char_Index( face, (unsigned char)*p ), hinted ) ) ) { #ifdef DEBUG if ( i <= first_glyph + 6 ) { LOG(( "metrics[%02d] = [%x %x]\n", i, glyph->metrics.horiBearingX, glyph->metrics.horiAdvance )); if ( i == first_glyph + 6 ) LOG(( "-------------------------\n" )); } #endif Render_Glyph( x, y ); x += ( glyph->metrics.horiAdvance >> 6 ) + 1; if ( x + size->metrics.x_ppem > bit.width ) { x = start_x; y += step_y; if ( y >= bit.rows ) return FT_Err_Ok; } } else Fail++; i++; p++; } return FT_Err_Ok; }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2000, 2003, 2004, 2005 by */ +/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -34,7 +34,7 @@ #define MAXPTSIZE 500 /* dtp */ - char Header[128]; + char Header[256]; char* new_header = 0; const unsigned char* Text = (unsigned char*) @@ -795,7 +795,7 @@ Render_All( Num, ptsize ); } - sprintf( Header, "%s %s (file %s)", + sprintf( Header, "%.50s %.50s (file %.100s)", face->family_name, face->style_name, ft_basename( argv[file] ) ); @@ -830,7 +830,7 @@ } else { - sprintf( Header, "%s: not an MM font file, or could not be opened", + sprintf( Header, "%.100s: not an MM font file, or could not be opened", ft_basename( argv[file] ) ); }
CWE-119
null
null
8,001
Reset_Scale( int pointSize ) { (void)FT_Set_Char_Size( face, pointSize << 6, pointSize << 6, res, res ); }
DoS Exec Code Overflow
0
Reset_Scale( int pointSize ) { (void)FT_Set_Char_Size( face, pointSize << 6, pointSize << 6, res, res ); }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2000, 2003, 2004, 2005 by */ +/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -34,7 +34,7 @@ #define MAXPTSIZE 500 /* dtp */ - char Header[128]; + char Header[256]; char* new_header = 0; const unsigned char* Text = (unsigned char*) @@ -795,7 +795,7 @@ Render_All( Num, ptsize ); } - sprintf( Header, "%s %s (file %s)", + sprintf( Header, "%.50s %.50s (file %.100s)", face->family_name, face->style_name, ft_basename( argv[file] ) ); @@ -830,7 +830,7 @@ } else { - sprintf( Header, "%s: not an MM font file, or could not be opened", + sprintf( Header, "%.100s: not an MM font file, or could not be opened", ft_basename( argv[file] ) ); }
CWE-119
null
null
8,002
make_tag( char *s ) { int i; unsigned long l = 0; for ( i = 0; i < 4; i++ ) { if ( !s[i] ) break; l <<= 8; l += (unsigned long)s[i]; } return l; }
DoS Exec Code Overflow
0
make_tag( char *s ) { int i; unsigned long l = 0; for ( i = 0; i < 4; i++ ) { if ( !s[i] ) break; l <<= 8; l += (unsigned long)s[i]; } return l; }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2000, 2003, 2004, 2005 by */ +/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -34,7 +34,7 @@ #define MAXPTSIZE 500 /* dtp */ - char Header[128]; + char Header[256]; char* new_header = 0; const unsigned char* Text = (unsigned char*) @@ -795,7 +795,7 @@ Render_All( Num, ptsize ); } - sprintf( Header, "%s %s (file %s)", + sprintf( Header, "%.50s %.50s (file %.100s)", face->family_name, face->style_name, ft_basename( argv[file] ) ); @@ -830,7 +830,7 @@ } else { - sprintf( Header, "%s: not an MM font file, or could not be opened", + sprintf( Header, "%.100s: not an MM font file, or could not be opened", ft_basename( argv[file] ) ); }
CWE-119
null
null
8,003
parse_design_coords( char *s ) { for ( requested_cnt = 0; requested_cnt < T1_MAX_MM_AXIS && *s; requested_cnt++ ) { requested_pos[requested_cnt] = (FT_Fixed)( strtod( s, &s ) * 65536.0 ); while ( *s==' ' ) ++s; } }
DoS Exec Code Overflow
0
parse_design_coords( char *s ) { for ( requested_cnt = 0; requested_cnt < T1_MAX_MM_AXIS && *s; requested_cnt++ ) { requested_pos[requested_cnt] = (FT_Fixed)( strtod( s, &s ) * 65536.0 ); while ( *s==' ' ) ++s; } }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2000, 2003, 2004, 2005 by */ +/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -34,7 +34,7 @@ #define MAXPTSIZE 500 /* dtp */ - char Header[128]; + char Header[256]; char* new_header = 0; const unsigned char* Text = (unsigned char*) @@ -795,7 +795,7 @@ Render_All( Num, ptsize ); } - sprintf( Header, "%s %s (file %s)", + sprintf( Header, "%.50s %.50s (file %.100s)", face->family_name, face->style_name, ft_basename( argv[file] ) ); @@ -830,7 +830,7 @@ } else { - sprintf( Header, "%s: not an MM font file, or could not be opened", + sprintf( Header, "%.100s: not an MM font file, or could not be opened", ft_basename( argv[file] ) ); }
CWE-119
null
null
8,004
usage( char* execname ) { fprintf( stderr, "\n" ); fprintf( stderr, "ftmulti: multiple masters font viewer - part of FreeType\n" ); fprintf( stderr, "--------------------------------------------------------\n" ); fprintf( stderr, "\n" ); fprintf( stderr, "Usage: %s [options below] ppem fontname[.pfb|.ttf] ...\n", execname ); fprintf( stderr, "\n" ); fprintf( stderr, " -e encoding select encoding (default: no encoding)\n" ); fprintf( stderr, " -r R use resolution R dpi (default: 72 dpi)\n" ); fprintf( stderr, " -f index specify first glyph index to display\n" ); fprintf( stderr, " -d \"axis1 axis2 ...\"\n" " specify the design coordinates for each axis\n" ); fprintf( stderr, "\n" ); exit( 1 ); }
DoS Exec Code Overflow
0
usage( char* execname ) { fprintf( stderr, "\n" ); fprintf( stderr, "ftmulti: multiple masters font viewer - part of FreeType\n" ); fprintf( stderr, "--------------------------------------------------------\n" ); fprintf( stderr, "\n" ); fprintf( stderr, "Usage: %s [options below] ppem fontname[.pfb|.ttf] ...\n", execname ); fprintf( stderr, "\n" ); fprintf( stderr, " -e encoding select encoding (default: no encoding)\n" ); fprintf( stderr, " -r R use resolution R dpi (default: 72 dpi)\n" ); fprintf( stderr, " -f index specify first glyph index to display\n" ); fprintf( stderr, " -d \"axis1 axis2 ...\"\n" " specify the design coordinates for each axis\n" ); fprintf( stderr, "\n" ); exit( 1 ); }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2000, 2003, 2004, 2005 by */ +/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -34,7 +34,7 @@ #define MAXPTSIZE 500 /* dtp */ - char Header[128]; + char Header[256]; char* new_header = 0; const unsigned char* Text = (unsigned char*) @@ -795,7 +795,7 @@ Render_All( Num, ptsize ); } - sprintf( Header, "%s %s (file %s)", + sprintf( Header, "%.50s %.50s (file %.100s)", face->family_name, face->style_name, ft_basename( argv[file] ) ); @@ -830,7 +830,7 @@ } else { - sprintf( Header, "%s: not an MM font file, or could not be opened", + sprintf( Header, "%.100s: not an MM font file, or could not be opened", ft_basename( argv[file] ) ); }
CWE-119
null
null
8,005
Process_Event( grEvent* event ) { FTDemo_String_Context* sc = &status.sc; int ret = 0; if ( event->key >= '1' && event->key < '1' + N_RENDER_MODES ) { status.render_mode = event->key - '1'; event_render_mode_change( 0 ); return ret; } switch ( event->key ) { case grKeyEsc: case grKEY( 'q' ): ret = 1; break; case grKeyF1: case grKEY( '?' ): event_help(); break; case grKEY( 'a' ): handle->antialias = !handle->antialias; status.header = handle->antialias ? (char *)"anti-aliasing is now on" : (char *)"anti-aliasing is now off"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'b' ): handle->use_sbits = !handle->use_sbits; status.header = handle->use_sbits ? (char *)"embedded bitmaps are now used when available" : (char *)"embedded bitmaps are now ignored"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'f' ): handle->autohint = !handle->autohint; status.header = handle->autohint ? (char *)"forced auto-hinting is now on" : (char *)"forced auto-hinting is now off"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'h' ): handle->hinted = !handle->hinted; status.header = handle->hinted ? (char *)"glyph hinting is now active" : (char *)"glyph hinting is now ignored"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'l' ): handle->low_prec = !handle->low_prec; status.header = handle->low_prec ? (char *)"rendering precision is now forced to low" : (char *)"rendering precision is now normal"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'k' ): sc->kerning_mode = ( sc->kerning_mode + 1 ) % N_KERNING_MODES; status.header = sc->kerning_mode == KERNING_MODE_SMART ? (char *)"pair kerning and side bearing correction is now active" : sc->kerning_mode == KERNING_MODE_NORMAL ? (char *)"pair kerning is now active" : (char *)"pair kerning is now ignored"; break; case grKEY( 't' ): sc->kerning_degree = ( sc->kerning_degree + 1 ) % N_KERNING_DEGREES; status.header = sc->kerning_degree == KERNING_DEGREE_NONE ? (char *)"no track kerning" : sc->kerning_degree == KERNING_DEGREE_LIGHT ? (char *)"light track kerning active" : sc->kerning_degree == KERNING_DEGREE_MEDIUM ? (char *)"medium track kerning active" : (char *)"tight track kerning active"; break; case grKEY( 'V' ): sc->vertical = !sc->vertical; status.header = sc->vertical ? (char *)"using vertical layout" : (char *)"using horizontal layout"; break; case grKEY( 'G' ): sc->gamma_ramp = sc->gamma_ramp ? NULL : status.gamma_ramp; status.header = sc->gamma_ramp ? (char *)"gamma correction is now on" : (char *)"gamma correction is now off"; break; case grKEY( 'g' ): event_gamma_change( 0.1 ); break; case grKEY( 'v' ): event_gamma_change( -0.1 ); break; case grKEY( 'n' ): event_font_change( 1 ); break; case grKEY( 'p' ): event_font_change( -1 ); break; case grKeyUp: event_size_change( 64 ); break; case grKeyDown: event_size_change( -64 ); break; case grKeyPageUp: event_size_change( 640); break; case grKeyPageDown: event_size_change( -640 ); break; case grKeyLeft: event_angle_change( -3 ); break; case grKeyRight: event_angle_change( 3 ); break; case grKeyF7: event_angle_change( -30 ); break; case grKeyF8: event_angle_change( 30 ); break; default: break; } return ret; }
DoS Exec Code Overflow
0
Process_Event( grEvent* event ) { FTDemo_String_Context* sc = &status.sc; int ret = 0; if ( event->key >= '1' && event->key < '1' + N_RENDER_MODES ) { status.render_mode = event->key - '1'; event_render_mode_change( 0 ); return ret; } switch ( event->key ) { case grKeyEsc: case grKEY( 'q' ): ret = 1; break; case grKeyF1: case grKEY( '?' ): event_help(); break; case grKEY( 'a' ): handle->antialias = !handle->antialias; status.header = handle->antialias ? (char *)"anti-aliasing is now on" : (char *)"anti-aliasing is now off"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'b' ): handle->use_sbits = !handle->use_sbits; status.header = handle->use_sbits ? (char *)"embedded bitmaps are now used when available" : (char *)"embedded bitmaps are now ignored"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'f' ): handle->autohint = !handle->autohint; status.header = handle->autohint ? (char *)"forced auto-hinting is now on" : (char *)"forced auto-hinting is now off"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'h' ): handle->hinted = !handle->hinted; status.header = handle->hinted ? (char *)"glyph hinting is now active" : (char *)"glyph hinting is now ignored"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'l' ): handle->low_prec = !handle->low_prec; status.header = handle->low_prec ? (char *)"rendering precision is now forced to low" : (char *)"rendering precision is now normal"; FTDemo_Update_Current_Flags( handle ); break; case grKEY( 'k' ): sc->kerning_mode = ( sc->kerning_mode + 1 ) % N_KERNING_MODES; status.header = sc->kerning_mode == KERNING_MODE_SMART ? (char *)"pair kerning and side bearing correction is now active" : sc->kerning_mode == KERNING_MODE_NORMAL ? (char *)"pair kerning is now active" : (char *)"pair kerning is now ignored"; break; case grKEY( 't' ): sc->kerning_degree = ( sc->kerning_degree + 1 ) % N_KERNING_DEGREES; status.header = sc->kerning_degree == KERNING_DEGREE_NONE ? (char *)"no track kerning" : sc->kerning_degree == KERNING_DEGREE_LIGHT ? (char *)"light track kerning active" : sc->kerning_degree == KERNING_DEGREE_MEDIUM ? (char *)"medium track kerning active" : (char *)"tight track kerning active"; break; case grKEY( 'V' ): sc->vertical = !sc->vertical; status.header = sc->vertical ? (char *)"using vertical layout" : (char *)"using horizontal layout"; break; case grKEY( 'G' ): sc->gamma_ramp = sc->gamma_ramp ? NULL : status.gamma_ramp; status.header = sc->gamma_ramp ? (char *)"gamma correction is now on" : (char *)"gamma correction is now off"; break; case grKEY( 'g' ): event_gamma_change( 0.1 ); break; case grKEY( 'v' ): event_gamma_change( -0.1 ); break; case grKEY( 'n' ): event_font_change( 1 ); break; case grKEY( 'p' ): event_font_change( -1 ); break; case grKeyUp: event_size_change( 64 ); break; case grKeyDown: event_size_change( -64 ); break; case grKeyPageUp: event_size_change( 640); break; case grKeyPageDown: event_size_change( -640 ); break; case grKeyLeft: event_angle_change( -3 ); break; case grKeyRight: event_angle_change( 3 ); break; case grKeyF7: event_angle_change( -30 ); break; case grKeyF8: event_angle_change( 30 ); break; default: break; } return ret; }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,006
event_angle_change( int delta ) { double radian; FT_Fixed cosinus; FT_Fixed sinus; status.angle = ( status.angle + delta ) % 360; if ( status.angle == 0 ) { status.sc.matrix = NULL; return; } status.sc.matrix = &status.trans_matrix; if ( status.angle < 0 ) status.angle += 360; radian = status.angle * 3.14159 / 180.0; cosinus = (FT_Fixed)( cos( radian ) * 65536.0 ); sinus = (FT_Fixed)( sin( radian ) * 65536.0 ); status.trans_matrix.xx = cosinus; status.trans_matrix.yx = sinus; status.trans_matrix.xy = -sinus; status.trans_matrix.yy = cosinus; }
DoS Exec Code Overflow
0
event_angle_change( int delta ) { double radian; FT_Fixed cosinus; FT_Fixed sinus; status.angle = ( status.angle + delta ) % 360; if ( status.angle == 0 ) { status.sc.matrix = NULL; return; } status.sc.matrix = &status.trans_matrix; if ( status.angle < 0 ) status.angle += 360; radian = status.angle * 3.14159 / 180.0; cosinus = (FT_Fixed)( cos( radian ) * 65536.0 ); sinus = (FT_Fixed)( sin( radian ) * 65536.0 ); status.trans_matrix.xx = cosinus; status.trans_matrix.yx = sinus; status.trans_matrix.xy = -sinus; status.trans_matrix.yy = cosinus; }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,007
event_font_change( int delta ) { if ( status.font_index + delta >= handle->num_fonts || status.font_index + delta < 0 ) return; status.font_index += delta; FTDemo_Set_Current_Font( handle, handle->fonts[status.font_index] ); FTDemo_Set_Current_Charsize( handle, status.ptsize, status.res ); FTDemo_Update_Current_Flags( handle ); FTDemo_String_Set( handle, Text ); }
DoS Exec Code Overflow
0
event_font_change( int delta ) { if ( status.font_index + delta >= handle->num_fonts || status.font_index + delta < 0 ) return; status.font_index += delta; FTDemo_Set_Current_Font( handle, handle->fonts[status.font_index] ); FTDemo_Set_Current_Charsize( handle, status.ptsize, status.res ); FTDemo_Update_Current_Flags( handle ); FTDemo_String_Set( handle, Text ); }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,008
event_gamma_change( double delta ) { int i; double gamma_inv; status.gamma += delta; if ( status.gamma > 3.0 ) status.gamma = 3.0; else if ( status.gamma < 0.1 ) status.gamma = 0.1; sprintf( status.header_buffer, "gamma changed to %.1f", status.gamma ); status.header = status.header_buffer; gamma_inv = 1.0f / status.gamma; for ( i = 0; i < 256; i++ ) status.gamma_ramp[i] = (FT_Byte)( pow( (double)i / 255.0f, gamma_inv ) * 255.0f ); }
DoS Exec Code Overflow
0
event_gamma_change( double delta ) { int i; double gamma_inv; status.gamma += delta; if ( status.gamma > 3.0 ) status.gamma = 3.0; else if ( status.gamma < 0.1 ) status.gamma = 0.1; sprintf( status.header_buffer, "gamma changed to %.1f", status.gamma ); status.header = status.header_buffer; gamma_inv = 1.0f / status.gamma; for ( i = 0; i < 256; i++ ) status.gamma_ramp[i] = (FT_Byte)( pow( (double)i / 255.0f, gamma_inv ) * 255.0f ); }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,009
event_help( void ) { grEvent dummy_event; FTDemo_Display_Clear( display ); grGotoxy( 0, 0 ); grSetMargin( 2, 1 ); grGotobitmap( display->bitmap ); grWriteln( "FreeType String Viewer - part of the FreeType test suite" ); grLn(); grWriteln( "This program is used to display a string of text using" ); grWriteln( "the new convenience API of the FreeType 2 library." ); grLn(); grWriteln( "Use the following keys :" ); grLn(); grWriteln( " F1 or ? : display this help screen" ); grLn(); grWriteln( " a : toggle anti-aliasing" ); grWriteln( " b : toggle embedded bitmaps (and disable rotation)" ); grWriteln( " f : toggle forced auto-hinting" ); grWriteln( " h : toggle outline hinting" ); grWriteln( " l : toggle low precision rendering" ); grLn(); grWriteln( " 1-2 : select rendering mode" ); grWriteln( " k : cycle through kerning modes" ); grWriteln( " t : cycle through kerning degrees" ); grWriteln( " V : toggle vertical rendering" ); grLn(); grWriteln( " G : toggle gamma correction" ); grWriteln( " g : increase gamma by 0.1" ); grWriteln( " v : decrease gamma by 0.1" ); grLn(); grWriteln( " n : next font" ); grWriteln( " p : previous font" ); grLn(); grWriteln( " Up : increase pointsize by 1 unit" ); grWriteln( " Down : decrease pointsize by 1 unit" ); grWriteln( " Page Up : increase pointsize by 10 units" ); grWriteln( " Page Down : decrease pointsize by 10 units" ); grLn(); grWriteln( " Right : rotate counter-clockwise" ); grWriteln( " Left : rotate clockwise" ); grWriteln( " F7 : big rotate counter-clockwise" ); grWriteln( " F8 : big rotate clockwise" ); grLn(); grLn(); grWriteln( "press any key to exit this help screen" ); grRefreshSurface( display->surface ); grListenSurface( display->surface, gr_event_key, &dummy_event ); }
DoS Exec Code Overflow
0
event_help( void ) { grEvent dummy_event; FTDemo_Display_Clear( display ); grGotoxy( 0, 0 ); grSetMargin( 2, 1 ); grGotobitmap( display->bitmap ); grWriteln( "FreeType String Viewer - part of the FreeType test suite" ); grLn(); grWriteln( "This program is used to display a string of text using" ); grWriteln( "the new convenience API of the FreeType 2 library." ); grLn(); grWriteln( "Use the following keys :" ); grLn(); grWriteln( " F1 or ? : display this help screen" ); grLn(); grWriteln( " a : toggle anti-aliasing" ); grWriteln( " b : toggle embedded bitmaps (and disable rotation)" ); grWriteln( " f : toggle forced auto-hinting" ); grWriteln( " h : toggle outline hinting" ); grWriteln( " l : toggle low precision rendering" ); grLn(); grWriteln( " 1-2 : select rendering mode" ); grWriteln( " k : cycle through kerning modes" ); grWriteln( " t : cycle through kerning degrees" ); grWriteln( " V : toggle vertical rendering" ); grLn(); grWriteln( " G : toggle gamma correction" ); grWriteln( " g : increase gamma by 0.1" ); grWriteln( " v : decrease gamma by 0.1" ); grLn(); grWriteln( " n : next font" ); grWriteln( " p : previous font" ); grLn(); grWriteln( " Up : increase pointsize by 1 unit" ); grWriteln( " Down : decrease pointsize by 1 unit" ); grWriteln( " Page Up : increase pointsize by 10 units" ); grWriteln( " Page Down : decrease pointsize by 10 units" ); grLn(); grWriteln( " Right : rotate counter-clockwise" ); grWriteln( " Left : rotate clockwise" ); grWriteln( " F7 : big rotate counter-clockwise" ); grWriteln( " F8 : big rotate clockwise" ); grLn(); grLn(); grWriteln( "press any key to exit this help screen" ); grRefreshSurface( display->surface ); grListenSurface( display->surface, gr_event_key, &dummy_event ); }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,010
gamma_ramp_draw( FT_Byte gamma_ramp[256], grBitmap* bitmap ) { int i, x, y; FT_Byte* p = (FT_Byte*)bitmap->buffer; if ( bitmap->pitch < 0 ) p += -bitmap->pitch * ( bitmap->rows - 1 ); x = ( bitmap->width - 256 ) / 2; y = ( bitmap->rows + 256 ) / 2; for (i = 0; i < 256; i++) p[bitmap->pitch * ( y - gamma_ramp[i] ) + ( x + i )] = 80; }
DoS Exec Code Overflow
0
gamma_ramp_draw( FT_Byte gamma_ramp[256], grBitmap* bitmap ) { int i, x, y; FT_Byte* p = (FT_Byte*)bitmap->buffer; if ( bitmap->pitch < 0 ) p += -bitmap->pitch * ( bitmap->rows - 1 ); x = ( bitmap->width - 256 ) / 2; y = ( bitmap->rows + 256 ) / 2; for (i = 0; i < 256; i++) p[bitmap->pitch * ( y - gamma_ramp[i] ) + ( x + i )] = 80; }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,011
main( int argc, char** argv ) { grEvent event; parse_cmdline( &argc, &argv ); /* Initialize engine */ handle = FTDemo_New( status.encoding ); handle->use_sbits = 0; FTDemo_Update_Current_Flags( handle ); for ( ; argc > 0; argc--, argv++ ) { error = FTDemo_Install_Font( handle, argv[0] ); if ( error ) { fprintf( stderr, "failed to install %s", argv[0] ); if ( error == FT_Err_Invalid_CharMap_Handle ) fprintf( stderr, ": missing valid charmap\n" ); else fprintf( stderr, "\n" ); } } if ( handle->num_fonts == 0 ) PanicZ( "could not open any font file" ); display = FTDemo_Display_New( gr_pixel_mode_gray ); display->back_color.value = 0; display->fore_color.value = 0xff; if ( !display ) PanicZ( "could not allocate display surface" ); grSetTitle( display->surface, "FreeType String Viewer - press F1 for help" ); event_gamma_change( 0 ); event_font_change( 0 ); status.header = 0; for ( ;; ) { FTDemo_Display_Clear( display ); switch ( status.render_mode ) { case RENDER_MODE_STRING: status.sc.center = 1L << 15; error = FTDemo_String_Draw( handle, display, &status.sc, display->bitmap->width / 2, display->bitmap->rows / 2 ); break; case RENDER_MODE_KERNCMP: { FTDemo_String_Context sc = status.sc; FT_Int x, y; FT_UInt height; x = 55; /* whatever.. */ height = status.ptsize * status.res / 72; if ( height < CELLSTRING_HEIGHT ) height = CELLSTRING_HEIGHT; /* First line: none */ sc.center = 0; sc.kerning_mode = 0; sc.kerning_degree = 0; sc.vertical = 0; sc.matrix = NULL; y = CELLSTRING_HEIGHT * 2 + display->bitmap->rows / 4 + height; grWriteCellString( display->bitmap, 5, y - ( height + CELLSTRING_HEIGHT ) / 2, "none", display->fore_color ); error = FTDemo_String_Draw( handle, display, &sc, x, y ); /* Second line: track kern only */ sc.kerning_degree = status.sc.kerning_degree; y += height; grWriteCellString( display->bitmap, 5, y - ( height + CELLSTRING_HEIGHT ) / 2, "track", display->fore_color ); error = FTDemo_String_Draw( handle, display, &sc, x, y ); /* Third line: track kern + pair kern */ sc.kerning_mode = status.sc.kerning_mode; y += height; grWriteCellString( display->bitmap, 5, y - ( height + CELLSTRING_HEIGHT ) / 2, "both", display->fore_color ); error = FTDemo_String_Draw( handle, display, &sc, x, y ); } break; } if ( !error && status.sc.gamma_ramp ) gamma_ramp_draw( status.gamma_ramp, display->bitmap ); write_header( error ); status.header = 0; grListenSurface( display->surface, 0, &event ); if ( Process_Event( &event ) ) break; } printf( "Execution completed successfully.\n" ); FTDemo_Display_Done( display ); FTDemo_Done( handle ); exit( 0 ); /* for safety reasons */ return 0; /* never reached */ }
DoS Exec Code Overflow
0
main( int argc, char** argv ) { grEvent event; parse_cmdline( &argc, &argv ); /* Initialize engine */ handle = FTDemo_New( status.encoding ); handle->use_sbits = 0; FTDemo_Update_Current_Flags( handle ); for ( ; argc > 0; argc--, argv++ ) { error = FTDemo_Install_Font( handle, argv[0] ); if ( error ) { fprintf( stderr, "failed to install %s", argv[0] ); if ( error == FT_Err_Invalid_CharMap_Handle ) fprintf( stderr, ": missing valid charmap\n" ); else fprintf( stderr, "\n" ); } } if ( handle->num_fonts == 0 ) PanicZ( "could not open any font file" ); display = FTDemo_Display_New( gr_pixel_mode_gray ); display->back_color.value = 0; display->fore_color.value = 0xff; if ( !display ) PanicZ( "could not allocate display surface" ); grSetTitle( display->surface, "FreeType String Viewer - press F1 for help" ); event_gamma_change( 0 ); event_font_change( 0 ); status.header = 0; for ( ;; ) { FTDemo_Display_Clear( display ); switch ( status.render_mode ) { case RENDER_MODE_STRING: status.sc.center = 1L << 15; error = FTDemo_String_Draw( handle, display, &status.sc, display->bitmap->width / 2, display->bitmap->rows / 2 ); break; case RENDER_MODE_KERNCMP: { FTDemo_String_Context sc = status.sc; FT_Int x, y; FT_UInt height; x = 55; /* whatever.. */ height = status.ptsize * status.res / 72; if ( height < CELLSTRING_HEIGHT ) height = CELLSTRING_HEIGHT; /* First line: none */ sc.center = 0; sc.kerning_mode = 0; sc.kerning_degree = 0; sc.vertical = 0; sc.matrix = NULL; y = CELLSTRING_HEIGHT * 2 + display->bitmap->rows / 4 + height; grWriteCellString( display->bitmap, 5, y - ( height + CELLSTRING_HEIGHT ) / 2, "none", display->fore_color ); error = FTDemo_String_Draw( handle, display, &sc, x, y ); /* Second line: track kern only */ sc.kerning_degree = status.sc.kerning_degree; y += height; grWriteCellString( display->bitmap, 5, y - ( height + CELLSTRING_HEIGHT ) / 2, "track", display->fore_color ); error = FTDemo_String_Draw( handle, display, &sc, x, y ); /* Third line: track kern + pair kern */ sc.kerning_mode = status.sc.kerning_mode; y += height; grWriteCellString( display->bitmap, 5, y - ( height + CELLSTRING_HEIGHT ) / 2, "both", display->fore_color ); error = FTDemo_String_Draw( handle, display, &sc, x, y ); } break; } if ( !error && status.sc.gamma_ramp ) gamma_ramp_draw( status.gamma_ramp, display->bitmap ); write_header( error ); status.header = 0; grListenSurface( display->surface, 0, &event ); if ( Process_Event( &event ) ) break; } printf( "Execution completed successfully.\n" ); FTDemo_Display_Done( display ); FTDemo_Done( handle ); exit( 0 ); /* for safety reasons */ return 0; /* never reached */ }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,012
parse_cmdline( int* argc, char*** argv ) { char* execname; int option; execname = ft_basename( (*argv)[0] ); while ( 1 ) { option = getopt( *argc, *argv, "e:m:r:" ); if ( option == -1 ) break; switch ( option ) { case 'e': status.encoding = FTDemo_Make_Encoding_Tag( optarg ); break; case 'r': status.res = atoi( optarg ); if ( status.res < 1 ) usage( execname ); break; case 'm': if ( *argc < 3 ) usage( execname ); Text = optarg; break; default: usage( execname ); break; } } *argc -= optind; *argv += optind; if ( *argc <= 1 ) usage( execname ); status.ptsize = (int)(atof( *argv[0] ) * 64.0); if ( status.ptsize == 0 ) status.ptsize = 64; (*argc)--; (*argv)++; }
DoS Exec Code Overflow
0
parse_cmdline( int* argc, char*** argv ) { char* execname; int option; execname = ft_basename( (*argv)[0] ); while ( 1 ) { option = getopt( *argc, *argv, "e:m:r:" ); if ( option == -1 ) break; switch ( option ) { case 'e': status.encoding = FTDemo_Make_Encoding_Tag( optarg ); break; case 'r': status.res = atoi( optarg ); if ( status.res < 1 ) usage( execname ); break; case 'm': if ( *argc < 3 ) usage( execname ); Text = optarg; break; default: usage( execname ); break; } } *argc -= optind; *argv += optind; if ( *argc <= 1 ) usage( execname ); status.ptsize = (int)(atof( *argv[0] ) * 64.0); if ( status.ptsize == 0 ) status.ptsize = 64; (*argc)--; (*argv)++; }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,013
usage( char* execname ) { fprintf( stderr, "\n" ); fprintf( stderr, "ftstring: string viewer -- part of the FreeType project\n" ); fprintf( stderr, "-------------------------------------------------------\n" ); fprintf( stderr, "\n" ); fprintf( stderr, "Usage: %s [options below] ppem fontname[.ttf|.ttc] ...\n", execname ); fprintf( stderr, "\n" ); fprintf( stderr, " -e enc specify encoding tag (default: unic)\n" ); fprintf( stderr, " -r R use resolution R dpi (default: 72 dpi)\n" ); fprintf( stderr, " -m message message to display\n" ); fprintf( stderr, "\n" ); exit( 1 ); }
DoS Exec Code Overflow
0
usage( char* execname ) { fprintf( stderr, "\n" ); fprintf( stderr, "ftstring: string viewer -- part of the FreeType project\n" ); fprintf( stderr, "-------------------------------------------------------\n" ); fprintf( stderr, "\n" ); fprintf( stderr, "Usage: %s [options below] ppem fontname[.ttf|.ttc] ...\n", execname ); fprintf( stderr, "\n" ); fprintf( stderr, " -e enc specify encoding tag (default: unic)\n" ); fprintf( stderr, " -r R use resolution R dpi (default: 72 dpi)\n" ); fprintf( stderr, " -m message message to display\n" ); fprintf( stderr, "\n" ); exit( 1 ); }
@@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /* */ @@ -413,19 +413,20 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, + sprintf( status.header_buffer, + "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,014
Fatal( const char* message ) { FTDemo_Display_Done( display ); FTDemo_Done( handle ); PanicZ( message ); }
DoS Exec Code Overflow
0
Fatal( const char* message ) { FTDemo_Display_Done( display ); FTDemo_Done( handle ); PanicZ( message ); }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,015
Render_All( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; while ( i < num_indices ) { int gindex; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FTDemo_Draw_Index( handle, display, gindex, &x, &y ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } i++; } return FT_Err_Ok; }
DoS Exec Code Overflow
0
Render_All( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; while ( i < num_indices ) { int gindex; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FTDemo_Draw_Index( handle, display, gindex, &x, &y ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } i++; } return FT_Err_Ok; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,016
Render_Embolden( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; while ( i < num_indices ) { int gindex; FT_Face face = size->face; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FT_Load_Glyph( face, gindex, handle->load_flags ); if ( !error ) { /* this is essentially the code of function */ /* `FT_GlyphSlot_Embolden' */ FT_GlyphSlot slot = face->glyph; FT_Library library = slot->library; FT_Pos xstr, ystr; if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && slot->format != FT_GLYPH_FORMAT_BITMAP ) goto Next; xstr = FT_MulFix( face->units_per_EM, face->size->metrics.y_scale ); xstr = (FT_Fixed)( xstr * status.bold_factor ); ystr = xstr; if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { error = FT_Outline_Embolden( &slot->outline, xstr ); /* ignore error */ xstr = xstr * 2; ystr = xstr; } else if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) { /* round to full pixels */ xstr &= ~63; ystr &= ~63; error = FT_GlyphSlot_Own_Bitmap( slot ); if ( error ) goto Next; error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr ); if ( error ) goto Next; } if ( slot->advance.x ) slot->advance.x += xstr; if ( slot->advance.y ) slot->advance.y += ystr; slot->metrics.width += xstr; slot->metrics.height += ystr; slot->metrics.horiBearingY += ystr; slot->metrics.horiAdvance += xstr; slot->metrics.vertBearingX -= xstr / 2; slot->metrics.vertBearingY += ystr; slot->metrics.vertAdvance += ystr; if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) slot->bitmap_top += ystr >> 6; error = FTDemo_Draw_Slot( handle, display, slot, &x, &y ); if ( error ) goto Next; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } } else Next: status.Fail++; i++; } return error; }
DoS Exec Code Overflow
0
Render_Embolden( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; while ( i < num_indices ) { int gindex; FT_Face face = size->face; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FT_Load_Glyph( face, gindex, handle->load_flags ); if ( !error ) { /* this is essentially the code of function */ /* `FT_GlyphSlot_Embolden' */ FT_GlyphSlot slot = face->glyph; FT_Library library = slot->library; FT_Pos xstr, ystr; if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && slot->format != FT_GLYPH_FORMAT_BITMAP ) goto Next; xstr = FT_MulFix( face->units_per_EM, face->size->metrics.y_scale ); xstr = (FT_Fixed)( xstr * status.bold_factor ); ystr = xstr; if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { error = FT_Outline_Embolden( &slot->outline, xstr ); /* ignore error */ xstr = xstr * 2; ystr = xstr; } else if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) { /* round to full pixels */ xstr &= ~63; ystr &= ~63; error = FT_GlyphSlot_Own_Bitmap( slot ); if ( error ) goto Next; error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr ); if ( error ) goto Next; } if ( slot->advance.x ) slot->advance.x += xstr; if ( slot->advance.y ) slot->advance.y += ystr; slot->metrics.width += xstr; slot->metrics.height += ystr; slot->metrics.horiBearingY += ystr; slot->metrics.horiAdvance += xstr; slot->metrics.vertBearingX -= xstr / 2; slot->metrics.vertBearingY += ystr; slot->metrics.vertAdvance += ystr; if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) slot->bitmap_top += ystr >> 6; error = FTDemo_Draw_Slot( handle, display, slot, &x, &y ); if ( error ) goto Next; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } } else Next: status.Fail++; i++; } return error; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,017
Render_Slanted( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; while ( i < num_indices ) { int gindex; FT_Face face = size->face; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FT_Load_Glyph( face, gindex, handle->load_flags ); if ( !error ) { FT_Matrix shear; FT_Outline* outline; /***************************************************************/ /* */ /* 2*2 affine transformation matrix, 16.16 fixed float format */ /* */ /* Shear matrix: */ /* */ /* | x' | | 1 k | | x | x' = x + ky */ /* | | = | | * | | <==> */ /* | y' | | 0 1 | | y | y' = y */ /* */ /* outline' shear outline */ /* */ /***************************************************************/ shear.xx = 1 << 16; shear.xy = (FT_Fixed)( status.slant * ( 1 << 16 ) ); shear.yx = 0; shear.yy = 1 << 16; outline = &(face->glyph)->outline; FT_Outline_Transform( outline, &shear ); error = FTDemo_Draw_Slot( handle, display, face->glyph, &x, &y ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } } else status.Fail++; i++; } return error; }
DoS Exec Code Overflow
0
Render_Slanted( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; while ( i < num_indices ) { int gindex; FT_Face face = size->face; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FT_Load_Glyph( face, gindex, handle->load_flags ); if ( !error ) { FT_Matrix shear; FT_Outline* outline; /***************************************************************/ /* */ /* 2*2 affine transformation matrix, 16.16 fixed float format */ /* */ /* Shear matrix: */ /* */ /* | x' | | 1 k | | x | x' = x + ky */ /* | | = | | * | | <==> */ /* | y' | | 0 1 | | y | y' = y */ /* */ /* outline' shear outline */ /* */ /***************************************************************/ shear.xx = 1 << 16; shear.xy = (FT_Fixed)( status.slant * ( 1 << 16 ) ); shear.yx = 0; shear.yy = 1 << 16; outline = &(face->glyph)->outline; FT_Outline_Transform( outline, &shear ); error = FTDemo_Draw_Slot( handle, display, face->glyph, &x, &y ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } } else status.Fail++; i++; } return error; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,018
Render_Stroke( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; FT_Stroker stroker = NULL; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; error = FT_Stroker_New( handle->library, &stroker ); if ( error ) goto Exit; FT_Stroker_Set( stroker, 64, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINEJOIN_ROUND, 0 ); while ( i < num_indices ) { int gindex; FT_GlyphSlot slot; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FT_Load_Glyph( size->face, gindex, handle->load_flags | FT_LOAD_NO_BITMAP ); slot = size->face->glyph; if ( !error && slot->format == FT_GLYPH_FORMAT_OUTLINE ) { FT_Glyph glyph; error = FT_Get_Glyph( slot, &glyph ); if ( error ) goto Next; error = FT_Glyph_Stroke( &glyph, stroker, 1 ); if ( error ) { FT_Done_Glyph( glyph ); goto Next; } error = FTDemo_Draw_Glyph( handle, display, glyph, &x, &y ); FT_Done_Glyph( glyph ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } } else { Next: status.Fail++; } i++; } Exit: if ( stroker ) FT_Stroker_Done( stroker ); return error; }
DoS Exec Code Overflow
0
Render_Stroke( int num_indices, int first_index ) { int start_x, start_y, step_x, step_y, x, y; int i; FT_Size size; FT_Stroker stroker = NULL; error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ return error; } INIT_SIZE( size, start_x, start_y, step_x, step_y, x, y ); i = first_index; error = FT_Stroker_New( handle->library, &stroker ); if ( error ) goto Exit; FT_Stroker_Set( stroker, 64, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINEJOIN_ROUND, 0 ); while ( i < num_indices ) { int gindex; FT_GlyphSlot slot; if ( handle->encoding == FT_ENCODING_NONE ) gindex = i; else gindex = FTDemo_Get_Index( handle, i ); error = FT_Load_Glyph( size->face, gindex, handle->load_flags | FT_LOAD_NO_BITMAP ); slot = size->face->glyph; if ( !error && slot->format == FT_GLYPH_FORMAT_OUTLINE ) { FT_Glyph glyph; error = FT_Get_Glyph( slot, &glyph ); if ( error ) goto Next; error = FT_Glyph_Stroke( &glyph, stroker, 1 ); if ( error ) { FT_Done_Glyph( glyph ); goto Next; } error = FTDemo_Draw_Glyph( handle, display, glyph, &x, &y ); FT_Done_Glyph( glyph ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; y += step_y; if ( Y_TOO_LONG( y, size, display ) ) break; } } else { Next: status.Fail++; } i++; } Exit: if ( stroker ) FT_Stroker_Done( stroker ); return error; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,019
Render_Waterfall( int first_size ) { int start_x, start_y, step_x, step_y, x, y; int pt_size, max_size = 100000; FT_Size size; FT_Face face; unsigned char text[256]; const unsigned char* p; error = FTC_Manager_LookupFace( handle->cache_manager, handle->scaler.face_id, &face ); if ( error ) { /* can't access the font file: do not render anything */ fprintf( stderr, "can't access font file %p\n", (void*)handle->scaler.face_id ); return 0; } if ( !FT_IS_SCALABLE( face ) ) { int i; max_size = 0; for ( i = 0; i < face->num_fixed_sizes; i++ ) if ( face->available_sizes[i].height >= max_size / 64 ) max_size = face->available_sizes[i].height * 64; } start_x = 4; start_y = 3 * HEADER_HEIGHT; for ( pt_size = first_size; pt_size < max_size; pt_size += 64 ) { sprintf( (char*)text, "%g: the quick brown fox jumps over the lazy dog" " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", pt_size / 64.0 ); p = text; FTDemo_Set_Current_Charsize( handle, pt_size, status.res ); error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ continue; } step_x = ( size->metrics.max_advance >> 6 ) + 4; step_y = ( size->metrics.height >> 6 ) + 1; x = start_x; y = start_y + ( size->metrics.ascender >> 6 ); start_y += step_y; if ( y >= display->bitmap->rows ) break; while ( *p ) { FT_UInt gindex; gindex = FTDemo_Get_Index( handle, *p ); error = FTDemo_Draw_Index( handle, display, gindex, &x, &y ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) break; p++; } } FTDemo_Set_Current_Charsize( handle, first_size, status.res ); return FT_Err_Ok; }
DoS Exec Code Overflow
0
Render_Waterfall( int first_size ) { int start_x, start_y, step_x, step_y, x, y; int pt_size, max_size = 100000; FT_Size size; FT_Face face; unsigned char text[256]; const unsigned char* p; error = FTC_Manager_LookupFace( handle->cache_manager, handle->scaler.face_id, &face ); if ( error ) { /* can't access the font file: do not render anything */ fprintf( stderr, "can't access font file %p\n", (void*)handle->scaler.face_id ); return 0; } if ( !FT_IS_SCALABLE( face ) ) { int i; max_size = 0; for ( i = 0; i < face->num_fixed_sizes; i++ ) if ( face->available_sizes[i].height >= max_size / 64 ) max_size = face->available_sizes[i].height * 64; } start_x = 4; start_y = 3 * HEADER_HEIGHT; for ( pt_size = first_size; pt_size < max_size; pt_size += 64 ) { sprintf( (char*)text, "%g: the quick brown fox jumps over the lazy dog" " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", pt_size / 64.0 ); p = text; FTDemo_Set_Current_Charsize( handle, pt_size, status.res ); error = FTDemo_Get_Size( handle, &size ); if ( error ) { /* probably a non-existent bitmap font size */ continue; } step_x = ( size->metrics.max_advance >> 6 ) + 4; step_y = ( size->metrics.height >> 6 ) + 1; x = start_x; y = start_y + ( size->metrics.ascender >> 6 ); start_y += step_y; if ( y >= display->bitmap->rows ) break; while ( *p ) { FT_UInt gindex; gindex = FTDemo_Get_Index( handle, *p ); error = FTDemo_Draw_Index( handle, display, gindex, &x, &y ); if ( error ) status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) break; p++; } } FTDemo_Set_Current_Charsize( handle, first_size, status.res ); return FT_Err_Ok; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,020
event_bold_change( double delta ) { status.bold_factor += delta; if ( status.bold_factor > 0.1 ) status.bold_factor = 0.1; else if ( status.bold_factor < -0.1 ) status.bold_factor = -0.1; sprintf( status.header_buffer, "embolding factor changed to %.3f", status.bold_factor ); status.header = status.header_buffer; }
DoS Exec Code Overflow
0
event_bold_change( double delta ) { status.bold_factor += delta; if ( status.bold_factor > 0.1 ) status.bold_factor = 0.1; else if ( status.bold_factor < -0.1 ) status.bold_factor = -0.1; sprintf( status.header_buffer, "embolding factor changed to %.3f", status.bold_factor ); status.header = status.header_buffer; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,021
event_gamma_change( double delta ) { status.gamma += delta; if ( status.gamma > 3.0 ) status.gamma = 3.0; else if ( status.gamma < 0.0 ) status.gamma = 0.0; grSetGlyphGamma( status.gamma ); sprintf( status.header_buffer, "gamma changed to %.1f%s", status.gamma, status.gamma == 0.0 ? " (sRGB mode)" : "" ); status.header = status.header_buffer; }
DoS Exec Code Overflow
0
event_gamma_change( double delta ) { status.gamma += delta; if ( status.gamma > 3.0 ) status.gamma = 3.0; else if ( status.gamma < 0.0 ) status.gamma = 0.0; grSetGlyphGamma( status.gamma ); sprintf( status.header_buffer, "gamma changed to %.1f%s", status.gamma, status.gamma == 0.0 ? " (sRGB mode)" : "" ); status.header = status.header_buffer; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,022
event_gamma_grid( void ) { grEvent dummy_event; int g; int yside = 11; int xside = 10; int levels = 17; int gammas = 30; int x_0 = ( display->bitmap->width - levels * xside ) / 2; int y_0 = ( display->bitmap->rows - gammas * ( yside + 1 ) ) / 2; int pitch = display->bitmap->pitch; FTDemo_Display_Clear( display ); grGotobitmap( display->bitmap ); if ( pitch < 0 ) pitch = -pitch; memset( display->bitmap->buffer, 100, pitch * display->bitmap->rows ); grWriteCellString( display->bitmap, 0, 0, "Gamma grid", display->fore_color ); for ( g = 1; g <= gammas; g += 1 ) { double ggamma = g / 10.0; char temp[6]; int y = y_0 + ( yside + 1 ) * ( g - 1 ); int nx, ny; unsigned char* line = display->bitmap->buffer + y * display->bitmap->pitch; if ( display->bitmap->pitch < 0 ) line -= display->bitmap->pitch * ( display->bitmap->rows - 1 ); line += x_0 * 3; grSetPixelMargin( x_0 - 32, y + ( yside - 8 ) / 2 ); grGotoxy( 0, 0 ); sprintf( temp, "%.1f", ggamma ); grWrite( temp ); for ( ny = 0; ny < yside; ny++, line += display->bitmap->pitch ) { unsigned char* dst = line; for ( nx = 0; nx < levels; nx++, dst += 3 * xside ) { double p = nx / (double)( levels - 1 ); int gm = (int)( 255.0 * pow( p, ggamma ) ); memset( dst, gm, xside * 3 ); } } } grRefreshSurface( display->surface ); grListenSurface( display->surface, gr_event_key, &dummy_event ); }
DoS Exec Code Overflow
0
event_gamma_grid( void ) { grEvent dummy_event; int g; int yside = 11; int xside = 10; int levels = 17; int gammas = 30; int x_0 = ( display->bitmap->width - levels * xside ) / 2; int y_0 = ( display->bitmap->rows - gammas * ( yside + 1 ) ) / 2; int pitch = display->bitmap->pitch; FTDemo_Display_Clear( display ); grGotobitmap( display->bitmap ); if ( pitch < 0 ) pitch = -pitch; memset( display->bitmap->buffer, 100, pitch * display->bitmap->rows ); grWriteCellString( display->bitmap, 0, 0, "Gamma grid", display->fore_color ); for ( g = 1; g <= gammas; g += 1 ) { double ggamma = g / 10.0; char temp[6]; int y = y_0 + ( yside + 1 ) * ( g - 1 ); int nx, ny; unsigned char* line = display->bitmap->buffer + y * display->bitmap->pitch; if ( display->bitmap->pitch < 0 ) line -= display->bitmap->pitch * ( display->bitmap->rows - 1 ); line += x_0 * 3; grSetPixelMargin( x_0 - 32, y + ( yside - 8 ) / 2 ); grGotoxy( 0, 0 ); sprintf( temp, "%.1f", ggamma ); grWrite( temp ); for ( ny = 0; ny < yside; ny++, line += display->bitmap->pitch ) { unsigned char* dst = line; for ( nx = 0; nx < levels; nx++, dst += 3 * xside ) { double p = nx / (double)( levels - 1 ); int gm = (int)( 255.0 * pow( p, ggamma ) ); memset( dst, gm, xside * 3 ); } } } grRefreshSurface( display->surface ); grListenSurface( display->surface, gr_event_key, &dummy_event ); }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,023
event_help( void ) { grEvent dummy_event; FTDemo_Display_Clear( display ); grGotoxy( 0, 0 ); grSetMargin( 2, 1 ); grGotobitmap( display->bitmap ); grWriteln( "FreeType Glyph Viewer - part of the FreeType test suite" ); grLn(); grWriteln( "This program is used to display all glyphs from one or" ); grWriteln( "several font files, with the FreeType library." ); grLn(); grWriteln( "Use the following keys:" ); grLn(); grWriteln( " F1, ? display this help screen" ); grLn(); grWriteln( " a toggle anti-aliasing" ); grWriteln( " b toggle embedded bitmaps" ); grWriteln( " c toggle between cache modes" ); grWriteln( " f toggle forced auto-hinting" ); grWriteln( " h toggle outline hinting" ); grWriteln( " l toggle low precision rendering" ); grLn(); grWriteln( " L cycle through LCD modes" ); grWriteln( " space cycle through rendering modes" ); grWriteln( " 1-6 select rendering mode" ); grLn(); grWriteln( " e, E adjust emboldening" ); grWriteln( " s, S adjust slanting" ); grLn(); grWriteln( " F toggle custom LCD filter mode" ); grWriteln( " [, ] select custom LCD filter weight" ); grWriteln( " -, +(=) adjust selected custom LCD filter weight" ); grLn(); grWriteln( " G show gamma ramp" ); grWriteln( " g, v adjust gamma value" ); grLn(); grWriteln( " p, n select previous/next font" ); grLn(); grWriteln( " Up, Down adjust pointsize by 1 unit" ); grWriteln( " PgUp, PgDn adjust pointsize by 10 units" ); grLn(); grWriteln( " Left, Right adjust index by 1" ); grWriteln( " F7, F8 adjust index by 10" ); grWriteln( " F9, F10 adjust index by 100" ); grWriteln( " F11, F12 adjust index by 1000" ); grLn(); grWriteln( "press any key to exit this help screen" ); grRefreshSurface( display->surface ); grListenSurface( display->surface, gr_event_key, &dummy_event ); }
DoS Exec Code Overflow
0
event_help( void ) { grEvent dummy_event; FTDemo_Display_Clear( display ); grGotoxy( 0, 0 ); grSetMargin( 2, 1 ); grGotobitmap( display->bitmap ); grWriteln( "FreeType Glyph Viewer - part of the FreeType test suite" ); grLn(); grWriteln( "This program is used to display all glyphs from one or" ); grWriteln( "several font files, with the FreeType library." ); grLn(); grWriteln( "Use the following keys:" ); grLn(); grWriteln( " F1, ? display this help screen" ); grLn(); grWriteln( " a toggle anti-aliasing" ); grWriteln( " b toggle embedded bitmaps" ); grWriteln( " c toggle between cache modes" ); grWriteln( " f toggle forced auto-hinting" ); grWriteln( " h toggle outline hinting" ); grWriteln( " l toggle low precision rendering" ); grLn(); grWriteln( " L cycle through LCD modes" ); grWriteln( " space cycle through rendering modes" ); grWriteln( " 1-6 select rendering mode" ); grLn(); grWriteln( " e, E adjust emboldening" ); grWriteln( " s, S adjust slanting" ); grLn(); grWriteln( " F toggle custom LCD filter mode" ); grWriteln( " [, ] select custom LCD filter weight" ); grWriteln( " -, +(=) adjust selected custom LCD filter weight" ); grLn(); grWriteln( " G show gamma ramp" ); grWriteln( " g, v adjust gamma value" ); grLn(); grWriteln( " p, n select previous/next font" ); grLn(); grWriteln( " Up, Down adjust pointsize by 1 unit" ); grWriteln( " PgUp, PgDn adjust pointsize by 10 units" ); grLn(); grWriteln( " Left, Right adjust index by 1" ); grWriteln( " F7, F8 adjust index by 10" ); grWriteln( " F9, F10 adjust index by 100" ); grWriteln( " F11, F12 adjust index by 1000" ); grLn(); grWriteln( "press any key to exit this help screen" ); grRefreshSurface( display->surface ); grListenSurface( display->surface, gr_event_key, &dummy_event ); }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,024
event_index_change( int delta ) { int num_indices = handle->current_font->num_indices; status.Num += delta; if ( status.Num < 0 ) status.Num = 0; else if ( status.Num >= num_indices ) status.Num = num_indices - 1; }
DoS Exec Code Overflow
0
event_index_change( int delta ) { int num_indices = handle->current_font->num_indices; status.Num += delta; if ( status.Num < 0 ) status.Num = 0; else if ( status.Num >= num_indices ) status.Num = num_indices - 1; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,025
event_render_mode_change( int delta ) { if ( delta ) { status.render_mode = ( status.render_mode + delta ) % N_RENDER_MODES; if ( status.render_mode < 0 ) status.render_mode += N_RENDER_MODES; } switch ( status.render_mode ) { case RENDER_MODE_ALL: status.header = (char *)"rendering all glyphs in font"; break; case RENDER_MODE_EMBOLDEN: status.header = (char *)"rendering emboldened text"; break; case RENDER_MODE_SLANTED: status.header = (char *)"rendering slanted text"; break; case RENDER_MODE_STROKE: status.header = (char *)"rendering stroked text"; break; case RENDER_MODE_TEXT: status.header = (char *)"rendering test text string"; break; case RENDER_MODE_WATERFALL: status.header = (char *)"rendering glyph waterfall"; break; } }
DoS Exec Code Overflow
0
event_render_mode_change( int delta ) { if ( delta ) { status.render_mode = ( status.render_mode + delta ) % N_RENDER_MODES; if ( status.render_mode < 0 ) status.render_mode += N_RENDER_MODES; } switch ( status.render_mode ) { case RENDER_MODE_ALL: status.header = (char *)"rendering all glyphs in font"; break; case RENDER_MODE_EMBOLDEN: status.header = (char *)"rendering emboldened text"; break; case RENDER_MODE_SLANTED: status.header = (char *)"rendering slanted text"; break; case RENDER_MODE_STROKE: status.header = (char *)"rendering stroked text"; break; case RENDER_MODE_TEXT: status.header = (char *)"rendering test text string"; break; case RENDER_MODE_WATERFALL: status.header = (char *)"rendering glyph waterfall"; break; } }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,026
event_slant_change( double delta ) { status.slant += delta; if ( status.slant > 1.0 ) status.slant = 1.0; else if ( status.slant < -1.0 ) status.slant = -1.0; sprintf( status.header_buffer, "slanting changed to %.3f", status.slant ); status.header = status.header_buffer; }
DoS Exec Code Overflow
0
event_slant_change( double delta ) { status.slant += delta; if ( status.slant > 1.0 ) status.slant = 1.0; else if ( status.slant < -1.0 ) status.slant = -1.0; sprintf( status.header_buffer, "slanting changed to %.3f", status.slant ); status.header = status.header_buffer; }
@@ -1145,19 +1145,19 @@ switch ( error_code ) { case FT_Err_Ok: - sprintf( status.header_buffer, "%s %s (file `%s')", + sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", face->family_name, face->style_name, basename ); break; case FT_Err_Invalid_Pixel_Size: - sprintf( status.header_buffer, "Invalid pixel size (file `%s')", + sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", basename ); break; case FT_Err_Invalid_PPem: - sprintf( status.header_buffer, "Invalid ppem value (file `%s')", + sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", basename ); break; default: - sprintf( status.header_buffer, "File `%s': error 0x%04x", + sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, (FT_UShort)error_code ); break; }
CWE-119
null
null
8,027
Compute_Funcs( EXEC_OP ) { #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { /* If both vectors point rightwards along the x axis, set */ /* `both-x-axis' true, otherwise set it false. The x values only */ /* need be tested because the vector has been normalised to a unit */ /* vector of length 0x4000 = unity. */ CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 && CUR.GS.freeVector.x == 0x4000 ); /* Throw away projection and freedom vector information */ /* because the patents don't allow them to be stored. */ /* The relevant US Patents are 5155805 and 5325479. */ CUR.GS.projVector.x = 0; CUR.GS.projVector.y = 0; CUR.GS.freeVector.x = 0; CUR.GS.freeVector.y = 0; if ( CUR.GS.both_x_axis ) { CUR.func_project = Project_x; CUR.func_move = Direct_Move_X; CUR.func_move_orig = Direct_Move_Orig_X; } else { CUR.func_project = Project_y; CUR.func_move = Direct_Move_Y; CUR.func_move_orig = Direct_Move_Orig_Y; } if ( CUR.GS.dualVector.x == 0x4000 ) CUR.func_dualproj = Project_x; else { if ( CUR.GS.dualVector.y == 0x4000 ) CUR.func_dualproj = Project_y; else CUR.func_dualproj = Dual_Project; } /* Force recalculation of cached aspect ratio */ CUR.tt_metrics.ratio = 0; return; } #endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */ if ( CUR.GS.freeVector.x == 0x4000 ) CUR.F_dot_P = CUR.GS.projVector.x * 0x10000L; else { if ( CUR.GS.freeVector.y == 0x4000 ) CUR.F_dot_P = CUR.GS.projVector.y * 0x10000L; else CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 + (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4; } if ( CUR.GS.projVector.x == 0x4000 ) CUR.func_project = (TT_Project_Func)Project_x; else { if ( CUR.GS.projVector.y == 0x4000 ) CUR.func_project = (TT_Project_Func)Project_y; else CUR.func_project = (TT_Project_Func)Project; } if ( CUR.GS.dualVector.x == 0x4000 ) CUR.func_dualproj = (TT_Project_Func)Project_x; else { if ( CUR.GS.dualVector.y == 0x4000 ) CUR.func_dualproj = (TT_Project_Func)Project_y; else CUR.func_dualproj = (TT_Project_Func)Dual_Project; } CUR.func_move = (TT_Move_Func)Direct_Move; CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig; if ( CUR.F_dot_P == 0x40000000L ) { if ( CUR.GS.freeVector.x == 0x4000 ) { CUR.func_move = (TT_Move_Func)Direct_Move_X; CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; } else { if ( CUR.GS.freeVector.y == 0x4000 ) { CUR.func_move = (TT_Move_Func)Direct_Move_Y; CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; } } } /* at small sizes, F_dot_P can become too small, resulting */ /* in overflows and `spikes' in a number of glyphs like `w'. */ if ( FT_ABS( CUR.F_dot_P ) < 0x4000000L ) CUR.F_dot_P = 0x40000000L; /* Disable cached aspect ratio */ CUR.tt_metrics.ratio = 0; }
DoS Exec Code Overflow
0
Compute_Funcs( EXEC_OP ) { #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { /* If both vectors point rightwards along the x axis, set */ /* `both-x-axis' true, otherwise set it false. The x values only */ /* need be tested because the vector has been normalised to a unit */ /* vector of length 0x4000 = unity. */ CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 && CUR.GS.freeVector.x == 0x4000 ); /* Throw away projection and freedom vector information */ /* because the patents don't allow them to be stored. */ /* The relevant US Patents are 5155805 and 5325479. */ CUR.GS.projVector.x = 0; CUR.GS.projVector.y = 0; CUR.GS.freeVector.x = 0; CUR.GS.freeVector.y = 0; if ( CUR.GS.both_x_axis ) { CUR.func_project = Project_x; CUR.func_move = Direct_Move_X; CUR.func_move_orig = Direct_Move_Orig_X; } else { CUR.func_project = Project_y; CUR.func_move = Direct_Move_Y; CUR.func_move_orig = Direct_Move_Orig_Y; } if ( CUR.GS.dualVector.x == 0x4000 ) CUR.func_dualproj = Project_x; else { if ( CUR.GS.dualVector.y == 0x4000 ) CUR.func_dualproj = Project_y; else CUR.func_dualproj = Dual_Project; } /* Force recalculation of cached aspect ratio */ CUR.tt_metrics.ratio = 0; return; } #endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */ if ( CUR.GS.freeVector.x == 0x4000 ) CUR.F_dot_P = CUR.GS.projVector.x * 0x10000L; else { if ( CUR.GS.freeVector.y == 0x4000 ) CUR.F_dot_P = CUR.GS.projVector.y * 0x10000L; else CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 + (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4; } if ( CUR.GS.projVector.x == 0x4000 ) CUR.func_project = (TT_Project_Func)Project_x; else { if ( CUR.GS.projVector.y == 0x4000 ) CUR.func_project = (TT_Project_Func)Project_y; else CUR.func_project = (TT_Project_Func)Project; } if ( CUR.GS.dualVector.x == 0x4000 ) CUR.func_dualproj = (TT_Project_Func)Project_x; else { if ( CUR.GS.dualVector.y == 0x4000 ) CUR.func_dualproj = (TT_Project_Func)Project_y; else CUR.func_dualproj = (TT_Project_Func)Dual_Project; } CUR.func_move = (TT_Move_Func)Direct_Move; CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig; if ( CUR.F_dot_P == 0x40000000L ) { if ( CUR.GS.freeVector.x == 0x4000 ) { CUR.func_move = (TT_Move_Func)Direct_Move_X; CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; } else { if ( CUR.GS.freeVector.y == 0x4000 ) { CUR.func_move = (TT_Move_Func)Direct_Move_Y; CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; } } } /* at small sizes, F_dot_P can become too small, resulting */ /* in overflows and `spikes' in a number of glyphs like `w'. */ if ( FT_ABS( CUR.F_dot_P ) < 0x4000000L ) CUR.F_dot_P = 0x40000000L; /* Disable cached aspect ratio */ CUR.tt_metrics.ratio = 0; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,028
Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, FT_F26Dot6* y, TT_GlyphZone zone, FT_UShort* refp ) { TT_GlyphZoneRec zp; FT_UShort p; FT_F26Dot6 d; if ( CUR.opcode & 1 ) { zp = CUR.zp0; p = CUR.GS.rp1; } else { zp = CUR.zp1; p = CUR.GS.rp2; } if ( BOUNDS( p, zp.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; *refp = 0; return FAILURE; } *zone = zp; *refp = p; d = CUR_Func_project( zp.cur + p, zp.org + p ); #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { if ( CUR.GS.both_x_axis ) { *x = d; *y = 0; } else { *x = 0; *y = d; } } else #endif { *x = TT_MULDIV( d, (FT_Long)CUR.GS.freeVector.x * 0x10000L, CUR.F_dot_P ); *y = TT_MULDIV( d, (FT_Long)CUR.GS.freeVector.y * 0x10000L, CUR.F_dot_P ); } return SUCCESS; }
DoS Exec Code Overflow
0
Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, FT_F26Dot6* y, TT_GlyphZone zone, FT_UShort* refp ) { TT_GlyphZoneRec zp; FT_UShort p; FT_F26Dot6 d; if ( CUR.opcode & 1 ) { zp = CUR.zp0; p = CUR.GS.rp1; } else { zp = CUR.zp1; p = CUR.GS.rp2; } if ( BOUNDS( p, zp.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; *refp = 0; return FAILURE; } *zone = zp; *refp = p; d = CUR_Func_project( zp.cur + p, zp.org + p ); #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { if ( CUR.GS.both_x_axis ) { *x = d; *y = 0; } else { *x = 0; *y = d; } } else #endif { *x = TT_MULDIV( d, (FT_Long)CUR.GS.freeVector.x * 0x10000L, CUR.F_dot_P ); *y = TT_MULDIV( d, (FT_Long)CUR.GS.freeVector.y * 0x10000L, CUR.F_dot_P ); } return SUCCESS; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,029
Direct_Move( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_F26Dot6 v; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING FT_ASSERT( !CUR.face->unpatented_hinting ); #endif v = CUR.GS.freeVector.x; if ( v != 0 ) { zone->cur[point].x += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; } v = CUR.GS.freeVector.y; if ( v != 0 ) { zone->cur[point].y += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; } }
DoS Exec Code Overflow
0
Direct_Move( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_F26Dot6 v; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING FT_ASSERT( !CUR.face->unpatented_hinting ); #endif v = CUR.GS.freeVector.x; if ( v != 0 ) { zone->cur[point].x += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; } v = CUR.GS.freeVector.y; if ( v != 0 ) { zone->cur[point].y += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; } }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,030
Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_F26Dot6 v; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING FT_ASSERT( !CUR.face->unpatented_hinting ); #endif v = CUR.GS.freeVector.x; if ( v != 0 ) zone->org[point].x += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); v = CUR.GS.freeVector.y; if ( v != 0 ) zone->org[point].y += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); }
DoS Exec Code Overflow
0
Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_F26Dot6 v; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING FT_ASSERT( !CUR.face->unpatented_hinting ); #endif v = CUR.GS.freeVector.x; if ( v != 0 ) zone->org[point].x += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); v = CUR.GS.freeVector.y; if ( v != 0 ) zone->org[point].y += TT_MULDIV( distance, v * 0x10000L, CUR.F_dot_P ); }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,031
Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->org[point].x += distance; }
DoS Exec Code Overflow
0
Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->org[point].x += distance; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,032
Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->org[point].y += distance; }
DoS Exec Code Overflow
0
Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->org[point].y += distance; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,033
Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->cur[point].y += distance; zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; }
DoS Exec Code Overflow
0
Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ) { FT_UNUSED_EXEC; zone->cur[point].y += distance; zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,034
Ins_AA( INS_ARG ) { /* intentionally no longer supported */ }
DoS Exec Code Overflow
0
Ins_AA( INS_ARG ) { /* intentionally no longer supported */ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,035
Ins_ABS( INS_ARG ) { DO_ABS }
DoS Exec Code Overflow
0
Ins_ABS( INS_ARG ) { DO_ABS }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,036
Ins_ALIGNPTS( INS_ARG ) { FT_UShort p1, p2; FT_F26Dot6 distance; p1 = (FT_UShort)args[0]; p2 = (FT_UShort)args[1]; if ( BOUNDS( args[0], CUR.zp1.n_points ) || BOUNDS( args[1], CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } distance = CUR_Func_project( CUR.zp0.cur + p2, CUR.zp1.cur + p1 ) / 2; CUR_Func_move( &CUR.zp1, p1, distance ); CUR_Func_move( &CUR.zp0, p2, -distance ); }
DoS Exec Code Overflow
0
Ins_ALIGNPTS( INS_ARG ) { FT_UShort p1, p2; FT_F26Dot6 distance; p1 = (FT_UShort)args[0]; p2 = (FT_UShort)args[1]; if ( BOUNDS( args[0], CUR.zp1.n_points ) || BOUNDS( args[1], CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } distance = CUR_Func_project( CUR.zp0.cur + p2, CUR.zp1.cur + p1 ) / 2; CUR_Func_move( &CUR.zp1, p1, distance ); CUR_Func_move( &CUR.zp0, p2, -distance ); }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,037
Ins_ALIGNRP( INS_ARG ) { FT_UShort point; FT_F26Dot6 distance; FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } while ( CUR.GS.loop > 0 ) { CUR.args--; point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.zp1.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } } else { distance = CUR_Func_project( CUR.zp1.cur + point, CUR.zp0.cur + CUR.GS.rp0 ); CUR_Func_move( &CUR.zp1, point, -distance ); } CUR.GS.loop--; } CUR.GS.loop = 1; CUR.new_top = CUR.args; }
DoS Exec Code Overflow
0
Ins_ALIGNRP( INS_ARG ) { FT_UShort point; FT_F26Dot6 distance; FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } while ( CUR.GS.loop > 0 ) { CUR.args--; point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.zp1.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } } else { distance = CUR_Func_project( CUR.zp1.cur + point, CUR.zp0.cur + CUR.GS.rp0 ); CUR_Func_move( &CUR.zp1, point, -distance ); } CUR.GS.loop--; } CUR.GS.loop = 1; CUR.new_top = CUR.args; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,038
Ins_AND( INS_ARG ) { DO_AND }
DoS Exec Code Overflow
0
Ins_AND( INS_ARG ) { DO_AND }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,039
Ins_CEILING( INS_ARG ) { DO_CEILING }
DoS Exec Code Overflow
0
Ins_CEILING( INS_ARG ) { DO_CEILING }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,040
Ins_CINDEX( INS_ARG ) { DO_CINDEX }
DoS Exec Code Overflow
0
Ins_CINDEX( INS_ARG ) { DO_CINDEX }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,041
Ins_CLEAR( INS_ARG ) { DO_CLEAR }
DoS Exec Code Overflow
0
Ins_CLEAR( INS_ARG ) { DO_CLEAR }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,042
Ins_DEBUG( INS_ARG ) { DO_DEBUG }
DoS Exec Code Overflow
0
Ins_DEBUG( INS_ARG ) { DO_DEBUG }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,043
Ins_DELTAC( INS_ARG ) { FT_ULong nump, k; FT_ULong A, C; FT_Long B; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING /* Delta hinting is covered by US Patent 5159668. */ if ( CUR.face->unpatented_hinting ) { FT_Long n = args[0] * 2; if ( CUR.args < n ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= n; CUR.new_top = CUR.args; return; } #endif nump = (FT_ULong)args[0]; for ( k = 1; k <= nump; k++ ) { if ( CUR.args < 2 ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= 2; A = (FT_ULong)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; if ( BOUNDS( A, CUR.cvtSize ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } } else { C = ( (FT_ULong)B & 0xF0 ) >> 4; switch ( CUR.opcode ) { case 0x73: break; case 0x74: C += 16; break; case 0x75: C += 32; break; } C += CUR.GS.delta_base; if ( CURRENT_Ppem() == (FT_Long)C ) { B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; B = B * 64 / ( 1L << CUR.GS.delta_shift ); CUR_Func_move_cvt( A, B ); } } } CUR.new_top = CUR.args; }
DoS Exec Code Overflow
0
Ins_DELTAC( INS_ARG ) { FT_ULong nump, k; FT_ULong A, C; FT_Long B; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING /* Delta hinting is covered by US Patent 5159668. */ if ( CUR.face->unpatented_hinting ) { FT_Long n = args[0] * 2; if ( CUR.args < n ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= n; CUR.new_top = CUR.args; return; } #endif nump = (FT_ULong)args[0]; for ( k = 1; k <= nump; k++ ) { if ( CUR.args < 2 ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= 2; A = (FT_ULong)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; if ( BOUNDS( A, CUR.cvtSize ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } } else { C = ( (FT_ULong)B & 0xF0 ) >> 4; switch ( CUR.opcode ) { case 0x73: break; case 0x74: C += 16; break; case 0x75: C += 32; break; } C += CUR.GS.delta_base; if ( CURRENT_Ppem() == (FT_Long)C ) { B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; B = B * 64 / ( 1L << CUR.GS.delta_shift ); CUR_Func_move_cvt( A, B ); } } } CUR.new_top = CUR.args; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,044
Ins_DELTAP( INS_ARG ) { FT_ULong k, nump; FT_UShort A; FT_ULong C; FT_Long B; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING /* Delta hinting is covered by US Patent 5159668. */ if ( CUR.face->unpatented_hinting ) { FT_Long n = args[0] * 2; if ( CUR.args < n ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= n; CUR.new_top = CUR.args; return; } #endif nump = (FT_ULong)args[0]; /* some points theoretically may occur more than once, thus UShort isn't enough */ for ( k = 1; k <= nump; k++ ) { if ( CUR.args < 2 ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= 2; A = (FT_UShort)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; /* XXX: Because some popular fonts contain some invalid DeltaP */ /* instructions, we simply ignore them when the stacked */ /* point reference is off limit, rather than returning an */ /* error. As a delta instruction doesn't change a glyph */ /* in great ways, this shouldn't be a problem. */ if ( !BOUNDS( A, CUR.zp0.n_points ) ) { C = ( (FT_ULong)B & 0xF0 ) >> 4; switch ( CUR.opcode ) { case 0x5D: break; case 0x71: C += 16; break; case 0x72: C += 32; break; } C += CUR.GS.delta_base; if ( CURRENT_Ppem() == (FT_Long)C ) { B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; B = B * 64 / ( 1L << CUR.GS.delta_shift ); CUR_Func_move( &CUR.zp0, A, B ); } } else if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; } CUR.new_top = CUR.args; }
DoS Exec Code Overflow
0
Ins_DELTAP( INS_ARG ) { FT_ULong k, nump; FT_UShort A; FT_ULong C; FT_Long B; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING /* Delta hinting is covered by US Patent 5159668. */ if ( CUR.face->unpatented_hinting ) { FT_Long n = args[0] * 2; if ( CUR.args < n ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= n; CUR.new_top = CUR.args; return; } #endif nump = (FT_ULong)args[0]; /* some points theoretically may occur more than once, thus UShort isn't enough */ for ( k = 1; k <= nump; k++ ) { if ( CUR.args < 2 ) { CUR.error = TT_Err_Too_Few_Arguments; return; } CUR.args -= 2; A = (FT_UShort)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; /* XXX: Because some popular fonts contain some invalid DeltaP */ /* instructions, we simply ignore them when the stacked */ /* point reference is off limit, rather than returning an */ /* error. As a delta instruction doesn't change a glyph */ /* in great ways, this shouldn't be a problem. */ if ( !BOUNDS( A, CUR.zp0.n_points ) ) { C = ( (FT_ULong)B & 0xF0 ) >> 4; switch ( CUR.opcode ) { case 0x5D: break; case 0x71: C += 16; break; case 0x72: C += 32; break; } C += CUR.GS.delta_base; if ( CURRENT_Ppem() == (FT_Long)C ) { B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; B = B * 64 / ( 1L << CUR.GS.delta_shift ); CUR_Func_move( &CUR.zp0, A, B ); } } else if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; } CUR.new_top = CUR.args; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,045
Ins_DEPTH( INS_ARG ) { DO_DEPTH }
DoS Exec Code Overflow
0
Ins_DEPTH( INS_ARG ) { DO_DEPTH }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,046
Ins_DIV( INS_ARG ) { DO_DIV }
DoS Exec Code Overflow
0
Ins_DIV( INS_ARG ) { DO_DIV }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,047
Ins_DUP( INS_ARG ) { DO_DUP }
DoS Exec Code Overflow
0
Ins_DUP( INS_ARG ) { DO_DUP }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,048
Ins_EIF( INS_ARG ) { /* nothing to do */ }
DoS Exec Code Overflow
0
Ins_EIF( INS_ARG ) { /* nothing to do */ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,049
Ins_ELSE( INS_ARG ) { FT_Int nIfs; FT_UNUSED_ARG; nIfs = 1; do { if ( SKIP_Code() == FAILURE ) return; switch ( CUR.opcode ) { case 0x58: /* IF */ nIfs++; break; case 0x59: /* EIF */ nIfs--; break; } } while ( nIfs != 0 ); }
DoS Exec Code Overflow
0
Ins_ELSE( INS_ARG ) { FT_Int nIfs; FT_UNUSED_ARG; nIfs = 1; do { if ( SKIP_Code() == FAILURE ) return; switch ( CUR.opcode ) { case 0x58: /* IF */ nIfs++; break; case 0x59: /* EIF */ nIfs--; break; } } while ( nIfs != 0 ); }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,050
Ins_ENDF( INS_ARG ) { TT_CallRec* pRec; FT_UNUSED_ARG; if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ { CUR.error = TT_Err_ENDF_In_Exec_Stream; return; } CUR.callTop--; pRec = &CUR.callStack[CUR.callTop]; pRec->Cur_Count--; CUR.step_ins = FALSE; if ( pRec->Cur_Count > 0 ) { CUR.callTop++; CUR.IP = pRec->Cur_Restart; } else /* Loop through the current function */ INS_Goto_CodeRange( pRec->Caller_Range, pRec->Caller_IP ); /* Exit the current call frame. */ /* NOTE: If the last instruction of a program is a */ /* CALL or LOOPCALL, the return address is */ /* always out of the code range. This is a */ /* valid address, and it is why we do not test */ /* the result of Ins_Goto_CodeRange() here! */ }
DoS Exec Code Overflow
0
Ins_ENDF( INS_ARG ) { TT_CallRec* pRec; FT_UNUSED_ARG; if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ { CUR.error = TT_Err_ENDF_In_Exec_Stream; return; } CUR.callTop--; pRec = &CUR.callStack[CUR.callTop]; pRec->Cur_Count--; CUR.step_ins = FALSE; if ( pRec->Cur_Count > 0 ) { CUR.callTop++; CUR.IP = pRec->Cur_Restart; } else /* Loop through the current function */ INS_Goto_CodeRange( pRec->Caller_Range, pRec->Caller_IP ); /* Exit the current call frame. */ /* NOTE: If the last instruction of a program is a */ /* CALL or LOOPCALL, the return address is */ /* always out of the code range. This is a */ /* valid address, and it is why we do not test */ /* the result of Ins_Goto_CodeRange() here! */ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,051
Ins_EQ( INS_ARG ) { DO_EQ }
DoS Exec Code Overflow
0
Ins_EQ( INS_ARG ) { DO_EQ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,052
Ins_EVEN( INS_ARG ) { DO_EVEN }
DoS Exec Code Overflow
0
Ins_EVEN( INS_ARG ) { DO_EVEN }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,053
Ins_FLIPPT( INS_ARG ) { FT_UShort point; FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) { CUR.error = TT_Err_Too_Few_Arguments; return; } while ( CUR.GS.loop > 0 ) { CUR.args--; point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.pts.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } } else CUR.pts.tags[point] ^= FT_CURVE_TAG_ON; CUR.GS.loop--; } CUR.GS.loop = 1; CUR.new_top = CUR.args; }
DoS Exec Code Overflow
0
Ins_FLIPPT( INS_ARG ) { FT_UShort point; FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) { CUR.error = TT_Err_Too_Few_Arguments; return; } while ( CUR.GS.loop > 0 ) { CUR.args--; point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.pts.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } } else CUR.pts.tags[point] ^= FT_CURVE_TAG_ON; CUR.GS.loop--; } CUR.GS.loop = 1; CUR.new_top = CUR.args; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,054
Ins_FLIPRGON( INS_ARG ) { FT_UShort I, K, L; K = (FT_UShort)args[1]; L = (FT_UShort)args[0]; if ( BOUNDS( K, CUR.pts.n_points ) || BOUNDS( L, CUR.pts.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } for ( I = L; I <= K; I++ ) CUR.pts.tags[I] |= FT_CURVE_TAG_ON; }
DoS Exec Code Overflow
0
Ins_FLIPRGON( INS_ARG ) { FT_UShort I, K, L; K = (FT_UShort)args[1]; L = (FT_UShort)args[0]; if ( BOUNDS( K, CUR.pts.n_points ) || BOUNDS( L, CUR.pts.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } for ( I = L; I <= K; I++ ) CUR.pts.tags[I] |= FT_CURVE_TAG_ON; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,055
Ins_FLOOR( INS_ARG ) { DO_FLOOR }
DoS Exec Code Overflow
0
Ins_FLOOR( INS_ARG ) { DO_FLOOR }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,056
Ins_GPV( INS_ARG ) { DO_GPV }
DoS Exec Code Overflow
0
Ins_GPV( INS_ARG ) { DO_GPV }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,057
Ins_GT( INS_ARG ) { DO_GT }
DoS Exec Code Overflow
0
Ins_GT( INS_ARG ) { DO_GT }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,058
Ins_GTEQ( INS_ARG ) { DO_GTEQ }
DoS Exec Code Overflow
0
Ins_GTEQ( INS_ARG ) { DO_GTEQ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,059
Ins_Goto_CodeRange( EXEC_OP_ FT_Int aRange, FT_ULong aIP ) { TT_CodeRange* range; if ( aRange < 1 || aRange > 3 ) { CUR.error = TT_Err_Bad_Argument; return FAILURE; } range = &CUR.codeRangeTable[aRange - 1]; if ( range->base == NULL ) /* invalid coderange */ { CUR.error = TT_Err_Invalid_CodeRange; return FAILURE; } /* NOTE: Because the last instruction of a program may be a CALL */ /* which will return to the first byte *after* the code */ /* range, we test for AIP <= Size, instead of AIP < Size. */ if ( aIP > range->size ) { CUR.error = TT_Err_Code_Overflow; return FAILURE; } CUR.code = range->base; CUR.codeSize = range->size; CUR.IP = aIP; CUR.curRange = aRange; return SUCCESS; }
DoS Exec Code Overflow
0
Ins_Goto_CodeRange( EXEC_OP_ FT_Int aRange, FT_ULong aIP ) { TT_CodeRange* range; if ( aRange < 1 || aRange > 3 ) { CUR.error = TT_Err_Bad_Argument; return FAILURE; } range = &CUR.codeRangeTable[aRange - 1]; if ( range->base == NULL ) /* invalid coderange */ { CUR.error = TT_Err_Invalid_CodeRange; return FAILURE; } /* NOTE: Because the last instruction of a program may be a CALL */ /* which will return to the first byte *after* the code */ /* range, we test for AIP <= Size, instead of AIP < Size. */ if ( aIP > range->size ) { CUR.error = TT_Err_Code_Overflow; return FAILURE; } CUR.code = range->base; CUR.codeSize = range->size; CUR.IP = aIP; CUR.curRange = aRange; return SUCCESS; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,060
Ins_IDEF( INS_ARG ) { TT_DefRecord* def; TT_DefRecord* limit; /* First of all, look for the same function in our table */ def = CUR.IDefs; limit = def + CUR.numIDefs; for ( ; def < limit; def++ ) if ( def->opc == (FT_ULong)args[0] ) break; if ( def == limit ) { /* check that there is enough room for a new instruction */ if ( CUR.numIDefs >= CUR.maxIDefs ) { CUR.error = TT_Err_Too_Many_Instruction_Defs; return; } CUR.numIDefs++; } /* opcode must be unsigned 8-bit integer */ if ( 0 > args[0] || args[0] > 0x00FF ) { CUR.error = TT_Err_Too_Many_Instruction_Defs; return; } def->opc = (FT_Byte)args[0]; def->start = CUR.IP + 1; def->range = CUR.curRange; def->active = TRUE; if ( (FT_ULong)args[0] > CUR.maxIns ) CUR.maxIns = (FT_Byte)args[0]; /* Now skip the whole function definition. */ /* We don't allow nested IDEFs & FDEFs. */ while ( SKIP_Code() == SUCCESS ) { switch ( CUR.opcode ) { case 0x89: /* IDEF */ case 0x2C: /* FDEF */ CUR.error = TT_Err_Nested_DEFS; return; case 0x2D: /* ENDF */ return; } } }
DoS Exec Code Overflow
0
Ins_IDEF( INS_ARG ) { TT_DefRecord* def; TT_DefRecord* limit; /* First of all, look for the same function in our table */ def = CUR.IDefs; limit = def + CUR.numIDefs; for ( ; def < limit; def++ ) if ( def->opc == (FT_ULong)args[0] ) break; if ( def == limit ) { /* check that there is enough room for a new instruction */ if ( CUR.numIDefs >= CUR.maxIDefs ) { CUR.error = TT_Err_Too_Many_Instruction_Defs; return; } CUR.numIDefs++; } /* opcode must be unsigned 8-bit integer */ if ( 0 > args[0] || args[0] > 0x00FF ) { CUR.error = TT_Err_Too_Many_Instruction_Defs; return; } def->opc = (FT_Byte)args[0]; def->start = CUR.IP + 1; def->range = CUR.curRange; def->active = TRUE; if ( (FT_ULong)args[0] > CUR.maxIns ) CUR.maxIns = (FT_Byte)args[0]; /* Now skip the whole function definition. */ /* We don't allow nested IDEFs & FDEFs. */ while ( SKIP_Code() == SUCCESS ) { switch ( CUR.opcode ) { case 0x89: /* IDEF */ case 0x2C: /* FDEF */ CUR.error = TT_Err_Nested_DEFS; return; case 0x2D: /* ENDF */ return; } } }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,061
Ins_IF( INS_ARG ) { FT_Int nIfs; FT_Bool Out; if ( args[0] != 0 ) return; nIfs = 1; Out = 0; do { if ( SKIP_Code() == FAILURE ) return; switch ( CUR.opcode ) { case 0x58: /* IF */ nIfs++; break; case 0x1B: /* ELSE */ Out = FT_BOOL( nIfs == 1 ); break; case 0x59: /* EIF */ nIfs--; Out = FT_BOOL( nIfs == 0 ); break; } } while ( Out == 0 ); }
DoS Exec Code Overflow
0
Ins_IF( INS_ARG ) { FT_Int nIfs; FT_Bool Out; if ( args[0] != 0 ) return; nIfs = 1; Out = 0; do { if ( SKIP_Code() == FAILURE ) return; switch ( CUR.opcode ) { case 0x58: /* IF */ nIfs++; break; case 0x1B: /* ELSE */ Out = FT_BOOL( nIfs == 1 ); break; case 0x59: /* EIF */ nIfs--; Out = FT_BOOL( nIfs == 0 ); break; } } while ( Out == 0 ); }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,062
Ins_INSTCTRL( INS_ARG ) { FT_Long K, L; K = args[1]; L = args[0]; if ( K < 1 || K > 2 ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } if ( L != 0 ) L = K; CUR.GS.instruct_control = FT_BOOL( ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L ); }
DoS Exec Code Overflow
0
Ins_INSTCTRL( INS_ARG ) { FT_Long K, L; K = args[1]; L = args[0]; if ( K < 1 || K > 2 ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } if ( L != 0 ) L = K; CUR.GS.instruct_control = FT_BOOL( ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L ); }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,063
Ins_IP( INS_ARG ) { FT_F26Dot6 old_range, cur_range; FT_Vector* orus_base; FT_Vector* cur_base; FT_Int twilight; FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) { CUR.error = TT_Err_Invalid_Reference; return; } /* * We need to deal in a special way with the twilight zone. * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0), * for every n. */ twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0; if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } if ( twilight ) orus_base = &CUR.zp0.org[CUR.GS.rp1]; else orus_base = &CUR.zp0.orus[CUR.GS.rp1]; cur_base = &CUR.zp0.cur[CUR.GS.rp1]; /* XXX: There are some glyphs in some braindead but popular */ /* fonts out there (e.g. [aeu]grave in monotype.ttf) */ /* calling IP[] with bad values of rp[12]. */ /* Do something sane when this odd thing happens. */ if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) || BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) ) { old_range = 0; cur_range = 0; } else { if ( twilight ) old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2], orus_base ); else old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2], orus_base ); cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base ); } for ( ; CUR.GS.loop > 0; --CUR.GS.loop ) { FT_UInt point = (FT_UInt)CUR.stack[--CUR.args]; FT_F26Dot6 org_dist, cur_dist, new_dist; /* check point bounds */ if ( BOUNDS( point, CUR.zp2.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } continue; } if ( twilight ) org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base ); else org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base ); cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base ); if ( org_dist ) new_dist = ( old_range != 0 ) ? TT_MULDIV( org_dist, cur_range, old_range ) : cur_dist; else new_dist = 0; CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist ); } CUR.GS.loop = 1; CUR.new_top = CUR.args; }
DoS Exec Code Overflow
0
Ins_IP( INS_ARG ) { FT_F26Dot6 old_range, cur_range; FT_Vector* orus_base; FT_Vector* cur_base; FT_Int twilight; FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) { CUR.error = TT_Err_Invalid_Reference; return; } /* * We need to deal in a special way with the twilight zone. * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0), * for every n. */ twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0; if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } if ( twilight ) orus_base = &CUR.zp0.org[CUR.GS.rp1]; else orus_base = &CUR.zp0.orus[CUR.GS.rp1]; cur_base = &CUR.zp0.cur[CUR.GS.rp1]; /* XXX: There are some glyphs in some braindead but popular */ /* fonts out there (e.g. [aeu]grave in monotype.ttf) */ /* calling IP[] with bad values of rp[12]. */ /* Do something sane when this odd thing happens. */ if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) || BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) ) { old_range = 0; cur_range = 0; } else { if ( twilight ) old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2], orus_base ); else old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2], orus_base ); cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base ); } for ( ; CUR.GS.loop > 0; --CUR.GS.loop ) { FT_UInt point = (FT_UInt)CUR.stack[--CUR.args]; FT_F26Dot6 org_dist, cur_dist, new_dist; /* check point bounds */ if ( BOUNDS( point, CUR.zp2.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } continue; } if ( twilight ) org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base ); else org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base ); cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base ); if ( org_dist ) new_dist = ( old_range != 0 ) ? TT_MULDIV( org_dist, cur_range, old_range ) : cur_dist; else new_dist = 0; CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist ); } CUR.GS.loop = 1; CUR.new_top = CUR.args; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,064
Ins_JMPR( INS_ARG ) { DO_JMPR }
DoS Exec Code Overflow
0
Ins_JMPR( INS_ARG ) { DO_JMPR }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,065
Ins_JROF( INS_ARG ) { DO_JROF }
DoS Exec Code Overflow
0
Ins_JROF( INS_ARG ) { DO_JROF }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,066
Ins_JROT( INS_ARG ) { DO_JROT }
DoS Exec Code Overflow
0
Ins_JROT( INS_ARG ) { DO_JROT }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,067
Ins_LOOPCALL( INS_ARG ) { FT_ULong F; TT_CallRec* pCrec; TT_DefRecord* def; /* first of all, check the index */ F = args[1]; if ( BOUNDS( F, CUR.maxFunc + 1 ) ) goto Fail; /* Except for some old Apple fonts, all functions in a TrueType */ /* font are defined in increasing order, starting from 0. This */ /* means that we normally have */ /* */ /* CUR.maxFunc+1 == CUR.numFDefs */ /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */ /* */ /* If this isn't true, we need to look up the function table. */ def = CUR.FDefs + F; if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F ) { /* look up the FDefs table */ TT_DefRecord* limit; def = CUR.FDefs; limit = def + CUR.numFDefs; while ( def < limit && def->opc != F ) def++; if ( def == limit ) goto Fail; } /* check that the function is active */ if ( !def->active ) goto Fail; /* check stack */ if ( CUR.callTop >= CUR.callSize ) { CUR.error = TT_Err_Stack_Overflow; return; } if ( args[0] > 0 ) { pCrec = CUR.callStack + CUR.callTop; pCrec->Caller_Range = CUR.curRange; pCrec->Caller_IP = CUR.IP + 1; pCrec->Cur_Count = (FT_Int)args[0]; pCrec->Cur_Restart = def->start; CUR.callTop++; INS_Goto_CodeRange( def->range, def->start ); CUR.step_ins = FALSE; } return; Fail: CUR.error = TT_Err_Invalid_Reference; }
DoS Exec Code Overflow
0
Ins_LOOPCALL( INS_ARG ) { FT_ULong F; TT_CallRec* pCrec; TT_DefRecord* def; /* first of all, check the index */ F = args[1]; if ( BOUNDS( F, CUR.maxFunc + 1 ) ) goto Fail; /* Except for some old Apple fonts, all functions in a TrueType */ /* font are defined in increasing order, starting from 0. This */ /* means that we normally have */ /* */ /* CUR.maxFunc+1 == CUR.numFDefs */ /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */ /* */ /* If this isn't true, we need to look up the function table. */ def = CUR.FDefs + F; if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F ) { /* look up the FDefs table */ TT_DefRecord* limit; def = CUR.FDefs; limit = def + CUR.numFDefs; while ( def < limit && def->opc != F ) def++; if ( def == limit ) goto Fail; } /* check that the function is active */ if ( !def->active ) goto Fail; /* check stack */ if ( CUR.callTop >= CUR.callSize ) { CUR.error = TT_Err_Stack_Overflow; return; } if ( args[0] > 0 ) { pCrec = CUR.callStack + CUR.callTop; pCrec->Caller_Range = CUR.curRange; pCrec->Caller_IP = CUR.IP + 1; pCrec->Cur_Count = (FT_Int)args[0]; pCrec->Cur_Restart = def->start; CUR.callTop++; INS_Goto_CodeRange( def->range, def->start ); CUR.step_ins = FALSE; } return; Fail: CUR.error = TT_Err_Invalid_Reference; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,068
Ins_LT( INS_ARG ) { DO_LT }
DoS Exec Code Overflow
0
Ins_LT( INS_ARG ) { DO_LT }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,069
Ins_LTEQ( INS_ARG ) { DO_LTEQ }
DoS Exec Code Overflow
0
Ins_LTEQ( INS_ARG ) { DO_LTEQ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,070
Ins_MAX( INS_ARG ) { DO_MAX }
DoS Exec Code Overflow
0
Ins_MAX( INS_ARG ) { DO_MAX }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,071
Ins_MD( INS_ARG ) { FT_UShort K, L; FT_F26Dot6 D; K = (FT_UShort)args[1]; L = (FT_UShort)args[0]; if( BOUNDS( L, CUR.zp0.n_points ) || BOUNDS( K, CUR.zp1.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } D = 0; } else { if ( CUR.opcode & 1 ) D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K ); else { FT_Vector* vec1 = CUR.zp0.orus + L; FT_Vector* vec2 = CUR.zp1.orus + K; if ( CUR.metrics.x_scale == CUR.metrics.y_scale ) { /* this should be faster */ D = CUR_Func_dualproj( vec1, vec2 ); D = TT_MULFIX( D, CUR.metrics.x_scale ); } else { FT_Vector vec; vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale ); vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale ); D = CUR_fast_dualproj( &vec ); } } } args[0] = D; }
DoS Exec Code Overflow
0
Ins_MD( INS_ARG ) { FT_UShort K, L; FT_F26Dot6 D; K = (FT_UShort)args[1]; L = (FT_UShort)args[0]; if( BOUNDS( L, CUR.zp0.n_points ) || BOUNDS( K, CUR.zp1.n_points ) ) { if ( CUR.pedantic_hinting ) { CUR.error = TT_Err_Invalid_Reference; return; } D = 0; } else { if ( CUR.opcode & 1 ) D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K ); else { FT_Vector* vec1 = CUR.zp0.orus + L; FT_Vector* vec2 = CUR.zp1.orus + K; if ( CUR.metrics.x_scale == CUR.metrics.y_scale ) { /* this should be faster */ D = CUR_Func_dualproj( vec1, vec2 ); D = TT_MULFIX( D, CUR.metrics.x_scale ); } else { FT_Vector vec; vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale ); vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale ); D = CUR_fast_dualproj( &vec ); } } } args[0] = D; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,072
Ins_MDAP( INS_ARG ) { FT_UShort point; FT_F26Dot6 cur_dist, distance; point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } /* XXX: Is there some undocumented feature while in the */ /* twilight zone? ? */ if ( ( CUR.opcode & 1 ) != 0 ) { cur_dist = CUR_fast_project( &CUR.zp0.cur[point] ); distance = CUR_Func_round( cur_dist, CUR.tt_metrics.compensations[0] ) - cur_dist; } else distance = 0; CUR_Func_move( &CUR.zp0, point, distance ); CUR.GS.rp0 = point; CUR.GS.rp1 = point; }
DoS Exec Code Overflow
0
Ins_MDAP( INS_ARG ) { FT_UShort point; FT_F26Dot6 cur_dist, distance; point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } /* XXX: Is there some undocumented feature while in the */ /* twilight zone? ? */ if ( ( CUR.opcode & 1 ) != 0 ) { cur_dist = CUR_fast_project( &CUR.zp0.cur[point] ); distance = CUR_Func_round( cur_dist, CUR.tt_metrics.compensations[0] ) - cur_dist; } else distance = 0; CUR_Func_move( &CUR.zp0, point, distance ); CUR.GS.rp0 = point; CUR.GS.rp1 = point; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,073
Ins_MIN( INS_ARG ) { DO_MIN }
DoS Exec Code Overflow
0
Ins_MIN( INS_ARG ) { DO_MIN }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,074
Ins_MINDEX( INS_ARG ) { FT_Long L, K; L = args[0]; if ( L <= 0 || L > CUR.args ) { CUR.error = TT_Err_Invalid_Reference; return; } K = CUR.stack[CUR.args - L]; FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ], &CUR.stack[CUR.args - L + 1], ( L - 1 ) ); CUR.stack[CUR.args - 1] = K; }
DoS Exec Code Overflow
0
Ins_MINDEX( INS_ARG ) { FT_Long L, K; L = args[0]; if ( L <= 0 || L > CUR.args ) { CUR.error = TT_Err_Invalid_Reference; return; } K = CUR.stack[CUR.args - L]; FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ], &CUR.stack[CUR.args - L + 1], ( L - 1 ) ); CUR.stack[CUR.args - 1] = K; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,075
Ins_MIRP( INS_ARG ) { FT_UShort point; FT_ULong cvtEntry; FT_F26Dot6 cvt_dist, distance, cur_dist, org_dist; point = (FT_UShort)args[0]; cvtEntry = (FT_ULong)( args[1] + 1 ); /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ if ( BOUNDS( point, CUR.zp1.n_points ) || BOUNDS( cvtEntry, CUR.cvtSize + 1 ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } if ( !cvtEntry ) cvt_dist = 0; else cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 ); /* single width test */ if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) < CUR.GS.single_width_cutin ) { if ( cvt_dist >= 0 ) cvt_dist = CUR.GS.single_width_value; else cvt_dist = -CUR.GS.single_width_value; } /* XXX: UNDOCUMENTED! -- twilight zone */ if ( CUR.GS.gep1 == 0 ) { CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x + TT_MulFix14( (FT_UInt32)cvt_dist, CUR.GS.freeVector.x ); CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y + TT_MulFix14( (FT_UInt32)cvt_dist, CUR.GS.freeVector.y ); CUR.zp1.cur[point] = CUR.zp0.cur[point]; } org_dist = CUR_Func_dualproj( &CUR.zp1.org[point], &CUR.zp0.org[CUR.GS.rp0] ); cur_dist = CUR_Func_project ( &CUR.zp1.cur[point], &CUR.zp0.cur[CUR.GS.rp0] ); /* auto-flip test */ if ( CUR.GS.auto_flip ) { if ( ( org_dist ^ cvt_dist ) < 0 ) cvt_dist = -cvt_dist; } /* control value cutin and round */ if ( ( CUR.opcode & 4 ) != 0 ) { /* XXX: UNDOCUMENTED! Only perform cut-in test when both points */ /* refer to the same zone. */ if ( CUR.GS.gep0 == CUR.GS.gep1 ) if ( FT_ABS( cvt_dist - org_dist ) >= CUR.GS.control_value_cutin ) cvt_dist = org_dist; distance = CUR_Func_round( cvt_dist, CUR.tt_metrics.compensations[CUR.opcode & 3] ); } else distance = ROUND_None( cvt_dist, CUR.tt_metrics.compensations[CUR.opcode & 3] ); /* minimum distance test */ if ( ( CUR.opcode & 8 ) != 0 ) { if ( org_dist >= 0 ) { if ( distance < CUR.GS.minimum_distance ) distance = CUR.GS.minimum_distance; } else { if ( distance > -CUR.GS.minimum_distance ) distance = -CUR.GS.minimum_distance; } } CUR_Func_move( &CUR.zp1, point, distance - cur_dist ); CUR.GS.rp1 = CUR.GS.rp0; if ( ( CUR.opcode & 16 ) != 0 ) CUR.GS.rp0 = point; /* XXX: UNDOCUMENTED! */ CUR.GS.rp2 = point; }
DoS Exec Code Overflow
0
Ins_MIRP( INS_ARG ) { FT_UShort point; FT_ULong cvtEntry; FT_F26Dot6 cvt_dist, distance, cur_dist, org_dist; point = (FT_UShort)args[0]; cvtEntry = (FT_ULong)( args[1] + 1 ); /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ if ( BOUNDS( point, CUR.zp1.n_points ) || BOUNDS( cvtEntry, CUR.cvtSize + 1 ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } if ( !cvtEntry ) cvt_dist = 0; else cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 ); /* single width test */ if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) < CUR.GS.single_width_cutin ) { if ( cvt_dist >= 0 ) cvt_dist = CUR.GS.single_width_value; else cvt_dist = -CUR.GS.single_width_value; } /* XXX: UNDOCUMENTED! -- twilight zone */ if ( CUR.GS.gep1 == 0 ) { CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x + TT_MulFix14( (FT_UInt32)cvt_dist, CUR.GS.freeVector.x ); CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y + TT_MulFix14( (FT_UInt32)cvt_dist, CUR.GS.freeVector.y ); CUR.zp1.cur[point] = CUR.zp0.cur[point]; } org_dist = CUR_Func_dualproj( &CUR.zp1.org[point], &CUR.zp0.org[CUR.GS.rp0] ); cur_dist = CUR_Func_project ( &CUR.zp1.cur[point], &CUR.zp0.cur[CUR.GS.rp0] ); /* auto-flip test */ if ( CUR.GS.auto_flip ) { if ( ( org_dist ^ cvt_dist ) < 0 ) cvt_dist = -cvt_dist; } /* control value cutin and round */ if ( ( CUR.opcode & 4 ) != 0 ) { /* XXX: UNDOCUMENTED! Only perform cut-in test when both points */ /* refer to the same zone. */ if ( CUR.GS.gep0 == CUR.GS.gep1 ) if ( FT_ABS( cvt_dist - org_dist ) >= CUR.GS.control_value_cutin ) cvt_dist = org_dist; distance = CUR_Func_round( cvt_dist, CUR.tt_metrics.compensations[CUR.opcode & 3] ); } else distance = ROUND_None( cvt_dist, CUR.tt_metrics.compensations[CUR.opcode & 3] ); /* minimum distance test */ if ( ( CUR.opcode & 8 ) != 0 ) { if ( org_dist >= 0 ) { if ( distance < CUR.GS.minimum_distance ) distance = CUR.GS.minimum_distance; } else { if ( distance > -CUR.GS.minimum_distance ) distance = -CUR.GS.minimum_distance; } } CUR_Func_move( &CUR.zp1, point, distance - cur_dist ); CUR.GS.rp1 = CUR.GS.rp0; if ( ( CUR.opcode & 16 ) != 0 ) CUR.GS.rp0 = point; /* XXX: UNDOCUMENTED! */ CUR.GS.rp2 = point; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,076
Ins_MPPEM( INS_ARG ) { DO_MPPEM }
DoS Exec Code Overflow
0
Ins_MPPEM( INS_ARG ) { DO_MPPEM }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,077
Ins_MPS( INS_ARG ) { DO_MPS }
DoS Exec Code Overflow
0
Ins_MPS( INS_ARG ) { DO_MPS }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,078
Ins_MSIRP( INS_ARG ) { FT_UShort point; FT_F26Dot6 distance; point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp1.n_points ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } /* XXX: UNDOCUMENTED! behaviour */ if ( CUR.GS.gep1 == 0 ) /* if the point that is to be moved */ /* is in twilight zone */ { CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0]; CUR_Func_move_orig( &CUR.zp1, point, args[1] ); CUR.zp1.cur[point] = CUR.zp1.org[point]; } distance = CUR_Func_project( CUR.zp1.cur + point, CUR.zp0.cur + CUR.GS.rp0 ); CUR_Func_move( &CUR.zp1, point, args[1] - distance ); CUR.GS.rp1 = CUR.GS.rp0; CUR.GS.rp2 = point; if ( ( CUR.opcode & 1 ) != 0 ) CUR.GS.rp0 = point; }
DoS Exec Code Overflow
0
Ins_MSIRP( INS_ARG ) { FT_UShort point; FT_F26Dot6 distance; point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp1.n_points ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; return; } /* XXX: UNDOCUMENTED! behaviour */ if ( CUR.GS.gep1 == 0 ) /* if the point that is to be moved */ /* is in twilight zone */ { CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0]; CUR_Func_move_orig( &CUR.zp1, point, args[1] ); CUR.zp1.cur[point] = CUR.zp1.org[point]; } distance = CUR_Func_project( CUR.zp1.cur + point, CUR.zp0.cur + CUR.GS.rp0 ); CUR_Func_move( &CUR.zp1, point, args[1] - distance ); CUR.GS.rp1 = CUR.GS.rp0; CUR.GS.rp2 = point; if ( ( CUR.opcode & 1 ) != 0 ) CUR.GS.rp0 = point; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,079
Ins_MUL( INS_ARG ) { DO_MUL }
DoS Exec Code Overflow
0
Ins_MUL( INS_ARG ) { DO_MUL }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,080
Ins_NEG( INS_ARG ) { DO_NEG }
DoS Exec Code Overflow
0
Ins_NEG( INS_ARG ) { DO_NEG }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,081
Ins_NEQ( INS_ARG ) { DO_NEQ }
DoS Exec Code Overflow
0
Ins_NEQ( INS_ARG ) { DO_NEQ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,082
Ins_NOT( INS_ARG ) { DO_NOT }
DoS Exec Code Overflow
0
Ins_NOT( INS_ARG ) { DO_NOT }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,083
Ins_NPUSHB( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)CUR.code[CUR.IP + 1]; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } for ( K = 1; K <= L; K++ ) args[K - 1] = CUR.code[CUR.IP + K + 1]; CUR.new_top += L; }
DoS Exec Code Overflow
0
Ins_NPUSHB( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)CUR.code[CUR.IP + 1]; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } for ( K = 1; K <= L; K++ ) args[K - 1] = CUR.code[CUR.IP + K + 1]; CUR.new_top += L; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,084
Ins_NPUSHW( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)CUR.code[CUR.IP + 1]; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } CUR.IP += 2; for ( K = 0; K < L; K++ ) args[K] = GET_ShortIns(); CUR.step_ins = FALSE; CUR.new_top += L; }
DoS Exec Code Overflow
0
Ins_NPUSHW( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)CUR.code[CUR.IP + 1]; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } CUR.IP += 2; for ( K = 0; K < L; K++ ) args[K] = GET_ShortIns(); CUR.step_ins = FALSE; CUR.new_top += L; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,085
Ins_NROUND( INS_ARG ) { DO_NROUND }
DoS Exec Code Overflow
0
Ins_NROUND( INS_ARG ) { DO_NROUND }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,086
Ins_ODD( INS_ARG ) { DO_ODD }
DoS Exec Code Overflow
0
Ins_ODD( INS_ARG ) { DO_ODD }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,087
Ins_OR( INS_ARG ) { DO_OR }
DoS Exec Code Overflow
0
Ins_OR( INS_ARG ) { DO_OR }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,088
Ins_POP( INS_ARG ) { /* nothing to do */ }
DoS Exec Code Overflow
0
Ins_POP( INS_ARG ) { /* nothing to do */ }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,089
Ins_PUSHB( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)( CUR.opcode - 0xB0 + 1 ); if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } for ( K = 1; K <= L; K++ ) args[K - 1] = CUR.code[CUR.IP + K]; }
DoS Exec Code Overflow
0
Ins_PUSHB( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)( CUR.opcode - 0xB0 + 1 ); if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } for ( K = 1; K <= L; K++ ) args[K - 1] = CUR.code[CUR.IP + K]; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,090
Ins_PUSHW( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)( CUR.opcode - 0xB8 + 1 ); if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } CUR.IP++; for ( K = 0; K < L; K++ ) args[K] = GET_ShortIns(); CUR.step_ins = FALSE; }
DoS Exec Code Overflow
0
Ins_PUSHW( INS_ARG ) { FT_UShort L, K; L = (FT_UShort)( CUR.opcode - 0xB8 + 1 ); if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { CUR.error = TT_Err_Stack_Overflow; return; } CUR.IP++; for ( K = 0; K < L; K++ ) args[K] = GET_ShortIns(); CUR.step_ins = FALSE; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,091
Ins_RCVT( INS_ARG ) { DO_RCVT }
DoS Exec Code Overflow
0
Ins_RCVT( INS_ARG ) { DO_RCVT }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,092
Ins_RDTG( INS_ARG ) { DO_RDTG }
DoS Exec Code Overflow
0
Ins_RDTG( INS_ARG ) { DO_RDTG }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,093
Ins_ROFF( INS_ARG ) { DO_ROFF }
DoS Exec Code Overflow
0
Ins_ROFF( INS_ARG ) { DO_ROFF }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,094
Ins_ROLL( INS_ARG ) { FT_Long A, B, C; FT_UNUSED_EXEC; A = args[2]; B = args[1]; C = args[0]; args[2] = C; args[1] = A; args[0] = B; }
DoS Exec Code Overflow
0
Ins_ROLL( INS_ARG ) { FT_Long A, B, C; FT_UNUSED_EXEC; A = args[2]; B = args[1]; C = args[0]; args[2] = C; args[1] = A; args[0] = B; }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,095
Ins_ROUND( INS_ARG ) { DO_ROUND }
DoS Exec Code Overflow
0
Ins_ROUND( INS_ARG ) { DO_ROUND }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,096
Ins_RS( INS_ARG ) { DO_RS }
DoS Exec Code Overflow
0
Ins_RS( INS_ARG ) { DO_RS }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,097
Ins_RTG( INS_ARG ) { DO_RTG }
DoS Exec Code Overflow
0
Ins_RTG( INS_ARG ) { DO_RTG }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,098
Ins_RTHG( INS_ARG ) { DO_RTHG }
DoS Exec Code Overflow
0
Ins_RTHG( INS_ARG ) { DO_RTHG }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null
8,099
Ins_S45ROUND( INS_ARG ) { DO_S45ROUND }
DoS Exec Code Overflow
0
Ins_S45ROUND( INS_ARG ) { DO_S45ROUND }
@@ -6755,8 +6755,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++;
CWE-119
null
null