func: static CVE_2013_1678_PATCHED__cairo_xlib_surface_add_glyph (cairo_xlib_display_t cairo_scaled_font_t   cairo_scaled_glyph_t **pscaled_glyph) unsigned long glyph_index ; unsigned char * data ; cairo_scaled_glyph_t * scaled_glyph = * pscaled_glyph ; cairo_image_surface_t * glyph_surface = scaled_glyph -> surface ; cairo_xlib_font_glyphset_info_t * glyphset_info ; glyph_index = _cairo_scaled_glyph_index ( scaled_glyph ); glyphset_info = _cairo_xlib_scaled_font_get_glyphset_info_for_pending_free_glyph ( scaled_font , glyph_index , glyph_surface ); if ( glyphset_info != NULL )  if ( ! glyph_surface )  status = _cairo_scaled_glyph_lookup ( scaled_font , glyph_index , CAIRO_SCALED_GLYPH_INFO_METRICS | CAIRO_SCALED_GLYPH_INFO_SURFACE , pscaled_glyph ); if ( unlikely ( status ) )  scaled_glyph = * pscaled_glyph; glyph_surface = scaled_glyph -> surface; if ( scaled_font -> surface_private == NULL )  status = _cairo_xlib_surface_font_init ( display , scaled_font ); if ( unlikely ( status ) )  glyphset_info = _cairo_xlib_scaled_font_get_glyphset_info_for_format ( scaled_font , glyph_surface -> format ); int len = cairo_format_stride_for_width ( glyphset_info -> format , glyph_surface -> width ) * glyph_surface -> height ; int max_request_size = ( XExtendedMaxRequestSize ( display -> display ) ? XExtendedMaxRequestSize ( display -> display ) : XMaxRequestSize ( display -> display ) ) * 4 - sz_xRenderAddGlyphsReq - sz_xGlyphInfo - 8 ; if ( len >= max_request_size )  if ( glyph_surface -> width == 0 || glyph_surface -> height == 0 )  cairo_surface_t * tmp_surface ; tmp_surface = cairo_image_surface_create ( glyphset_info -> format , 1 , 1 ); status = tmp_surface -> status; if ( unlikely ( status ) )  tmp_surface -> device_transform = glyph_surface -> base . device_transform; tmp_surface -> device_transform_inverse = glyph_surface -> base . device_transform_inverse; glyph_surface = ( cairo_image_surface_t * ) tmp_surface; if ( glyph_surface -> format != glyphset_info -> format )  cairo_surface_pattern_t pattern ; cairo_surface_t * tmp_surface ; tmp_surface = cairo_image_surface_create ( glyphset_info -> format , glyph_surface -> width , glyph_surface -> height ); status = tmp_surface -> status; if ( unlikely ( status ) )  tmp_surface -> device_transform = glyph_surface -> base . device_transform; tmp_surface -> device_transform_inverse = glyph_surface -> base . device_transform_inverse; status = _cairo_surface_paint ( tmp_surface , CAIRO_OPERATOR_SOURCE , & pattern . base , NULL ); glyph_surface = ( cairo_image_surface_t * ) tmp_surface; if ( unlikely ( status ) )  data = glyph_surface -> data; switch ( _cairo_xlib_get_glyphset_index_for_format ( scaled_glyph -> surface -> format ) )  if ( _native_byte_order_lsb ( ) != ( BitmapBitOrder ( display -> display ) == LSBFirst ) )  if ( _native_byte_order_lsb ( ) != ( ImageByteOrder ( display -> display ) == LSBFirst ) )  if ( data != glyph_surface -> data )  free ( data ); 