freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] Bug in error condition checking in ftgrays.c


From: Jeff Finger
Subject: [ft] Bug in error condition checking in ftgrays.c
Date: Sun, 13 Jan 2008 17:48:47 +0200

In freetype 2.3.5, in ftgrays.c, in function gray_raster_render, outline  is dereferenced and only later checked for being non-null. Presumably this is a logical typo and the checking should have been in the opposite order.

 

  static int

  gray_raster_render( PRaster                  raster,

                      const FT_Raster_Params*  params )

  {

    const FT_Outline*  outline    = (const FT_Outline*)params->source;

    const FT_Bitmap*   target_map = params->target;

    PWorker            worker;

 

    if ( !raster || !raster->buffer || !raster->buffer_size )

      return ErrRaster_Invalid_Argument;

 

    /* return immediately if the outline is empty */

    if ( outline->n_points == 0 || outline->n_contours <= 0 )

      return 0;

 

    if ( !outline || !outline->contours || !outline->points )

      return ErrRaster_Invalid_Outline;

  ….

 

Please forgive me if I should have sent this to freetype-devel instead.

 

Jeff Finger

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]