Ticket #28276: patch-ARB-glpng.diff

File patch-ARB-glpng.diff, 1.0 KB (added by matt.cottrell@…, 14 years ago)

Patch provided by the official ARB developers - solves crashes with earlier patch from Matt Cottrell

  • GL/glpng/glpng.c

     
    3737#include <math.h>
    3838#include <png.h>
    3939
     40#if 0
     41#define PNG_CHECK_SIG(header,size) png_check_sig(header,size) // old libpng
     42#else
     43#define PNG_CHECK_SIG(header,size) (png_sig_cmp(header,0,size)==0)
     44#endif
     45
    4046/* Used to decide if GL/gl.h supports the paletted extension */
    4147#ifdef GL_COLOR_INDEX1_EXT
    4248#define SUPPORTS_PALETTE_EXT
     
    278284    if (pinfo == NULL) return 0;
    279285
    280286    fread(header, 1, 8, fp);
    281     if (!png_check_sig(header, 8)) return 0;
     287    if (!PNG_CHECK_SIG(header, 8)) return 0;
    282288
    283289    png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    284290    info = png_create_info_struct(png);
     
    383389    png_uint_32 i;
    384390
    385391    fread(header, 1, 8, fp);
    386     if (!png_check_sig(header, 8)) return 0;
     392    if (!PNG_CHECK_SIG(header, 8)) return 0;
    387393
    388394    png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    389395    info = png_create_info_struct(png);