Don't like ads? PRO users don't see any ads ;-)
Guest

amaya-11.4.4-libpng15.patch

By: a guest on Mar 7th, 2012  |  syntax: None  |  size: 2.53 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- Amaya11.4.4/Amaya/thotlib/image/pnghandler.c        2009-09-09 20:55:42.000000000 +1100
  2. +++ Amaya11.4.4.new/Amaya/thotlib/image/pnghandler.c    2012-02-25 20:01:19.000000000 +1100
  3. @@ -10,9 +10,9 @@
  4.   *          R. Guetari (W3C/INRIA) - Initial Windows version
  5.   */
  6.  
  7. +#include "png.h"
  8.  #include "thot_gui.h"
  9.  #include "thot_sys.h"
  10. -#include "png.h"
  11.  #include "constmedia.h"
  12.  #include "typemedia.h"
  13.  #include "picture.h"
  14. @@ -128,13 +128,13 @@
  15.    png_byte      **ppbRowPointers;
  16.    unsigned char  *pixels;
  17.    unsigned int    i, j, passes;
  18. -  unsigned long   lw, lh;
  19. +  png_uint_32 lw, lh;
  20.    int             iBitDepth, iColorType;
  21.    double          dGamma;
  22.  
  23.      /* Checks the eight byte PNG signature*/
  24.      fread (pbSig, 1, 8, pfFile);
  25. -    if (!png_check_sig (pbSig, 8))
  26. +    if (png_sig_cmp (pbSig, 0, 8))
  27.          return NULL;  
  28.      /* create the two png(-info) structures*/
  29.      png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING,
  30. @@ -149,7 +149,7 @@
  31.          png_destroy_read_struct (&png_ptr, NULL, NULL);
  32.          return NULL;
  33.        }  
  34. -    if (setjmp (png_ptr->jmpbuf))
  35. +    if (setjmp (png_jmpbuf(png_ptr)))
  36.        {
  37.          /* Free all of the memory associated with the png_ptr and info_ptr */
  38.          png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
  39. @@ -169,13 +169,13 @@
  40.        png_set_strip_16 (png_ptr);
  41.      /* Grayscale =>RGB or RGBA */
  42.      if (iColorType == PNG_COLOR_TYPE_GRAY || iColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
  43. -      png_set_gray_to_rgb (png_ptr);
  44. +      png_set_expand_gray_1_2_4_to_8(png_ptr);
  45.      /* Palette indexed colors to RGB */
  46.      if (iColorType == PNG_COLOR_TYPE_PALETTE)
  47.        png_set_palette_to_rgb (png_ptr);
  48.      /* 8 bits / channel is needed */
  49.      if (iColorType == PNG_COLOR_TYPE_GRAY && iBitDepth < 8)
  50. -      png_set_gray_1_2_4_to_8(png_ptr);
  51. +      png_set_expand_gray_1_2_4_to_8(png_ptr);
  52.      /* all transparency type : 1 color, indexed => alpha channel*/
  53.      if (png_get_valid (png_ptr, info_ptr,PNG_INFO_tRNS))
  54.        png_set_tRNS_to_alpha (png_ptr);
  55. @@ -822,7 +822,7 @@
  56.     TtaReadClose (fp);
  57.     if (ret != 8)
  58.        return FALSE;
  59. -   ret = png_check_sig ((png_byte*)buf, 8);
  60. +   ret = !png_sig_cmp ((png_byte*)buf, 0, 8);
  61.     if (ret) return (TRUE);
  62.     return(FALSE);
  63.  }
  64. @@ -858,7 +858,7 @@
  65.        png_destroy_write_struct(&png, (png_infopp) NULL);
  66.        return FALSE;
  67.      }
  68. -  if (setjmp(png->jmpbuf))
  69. +  if (setjmp(png_jmpbuf(png)))
  70.      {
  71.          png_destroy_write_struct(&png, &pngInfo);
  72.          TtaWriteClose (pngFile);