Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 124828 | Differences between
and this patch

Collapse All | Expand All

(-)freetype-2.1.7.orig/src/base/ftutil.c (-2 / +11 lines)
Lines 51-56 Link Here
51
            FT_Long    size,
51
            FT_Long    size,
52
            void*     *P )
52
            void*     *P )
53
  {
53
  {
54
    FT_Error  error = FT_Err_Ok;
55
54
    FT_ASSERT( P != 0 );
56
    FT_ASSERT( P != 0 );
55
57
56
    if ( size > 0 )
58
    if ( size > 0 )
Lines 67-79 Link Here
67
      FT_MEM_ZERO( *P, size );
69
      FT_MEM_ZERO( *P, size );
68
    }
70
    }
69
    else
71
    else
72
    {
70
      *P = NULL;
73
      *P = NULL;
74
      if ( size < 0 )
75
	error = FT_Err_Invalid_Argument;
76
    }
71
77
72
    FT_TRACE7(( "FT_Alloc:" ));
78
    FT_TRACE7(( "FT_Alloc:" ));
73
    FT_TRACE7(( " size = %ld, block = 0x%08p, ref = 0x%08p\n",
79
    FT_TRACE7(( " size = %ld, block = 0x%08p, ref = 0x%08p\n",
74
                size, *P, P ));
80
                size, *P, P ));
75
81
76
    return FT_Err_Ok;
82
    return error;
77
  }
83
  }
78
84
79
85
Lines 95-106 Link Here
95
      return FT_Alloc( memory, size, P );
101
      return FT_Alloc( memory, size, P );
96
102
97
    /* if the new block if zero-sized, clear the current one */
103
    /* if the new block if zero-sized, clear the current one */
98
    if ( size <= 0 )
104
    if ( size == 0 )
99
    {
105
    {
100
      FT_Free( memory, P );
106
      FT_Free( memory, P );
101
      return FT_Err_Ok;
107
      return FT_Err_Ok;
102
    }
108
    }
103
109
110
    if ( size < 0 || current < 0 )
111
      return FT_Err_Invalid_Argument;
112
104
    Q = memory->realloc( memory, current, size, *P );
113
    Q = memory->realloc( memory, current, size, *P );
105
    if ( !Q )
114
    if ( !Q )
106
      goto Fail;
115
      goto Fail;

Return to bug 124828