Update of /cvsroot/fink/dists/10.7/stable/main/finkinfo/crypto
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25049

Modified Files:
        xpwn.patch 
Log Message:
fix build to work against libpng16

Index: xpwn.patch
===================================================================
RCS file: /cvsroot/fink/dists/10.7/stable/main/finkinfo/crypto/xpwn.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xpwn.patch  5 Aug 2013 21:05:28 -0000       1.1
+++ xpwn.patch  11 Aug 2013 19:15:30 -0000      1.2
@@ -22,3 +22,149 @@
  IF(HAVE_HW_CRYPTO)
        add_definitions(-DHAVE_HW_CRYPTO)
  ENDIF(HAVE_HW_CRYPTO)
+--- a/ipsw-patch/ibootim.c     2013-08-11 10:17:08.000000000 -0400
++++ b/ipsw-patch/ibootim.c     2013-08-11 10:36:10.000000000 -0400
+@@ -255,9 +255,11 @@
+       uint8_t *imageBuffer = malloc(imageFile->getLength(imageFile));
+       imageFile->read(imageFile, imageBuffer, 
imageFile->getLength(imageFile));
+ 
++      png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
++
+       png_bytepp row_pointers = (png_bytepp) malloc(sizeof(png_bytep) * 
info->header.height);
+       int i;
+-      for(i = 0; i < info_ptr->height; i++) {
++      for(i = 0; i < height; i++) {
+               row_pointers[i] = imageBuffer + (info->header.width * 
bytes_per_pixel * i);
+       }
+ 
+@@ -274,7 +276,24 @@
+       AbstractFile* imageFile;
+       unsigned char header[8];
+       InfoIBootIM* info;
++      png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 
NULL, pngError, pngWarn);
++      if (!png_ptr) {
++              return NULL;
++      }
++
++      png_infop info_ptr = png_create_info_struct(png_ptr);
++      if (!info_ptr)
++      {
++              png_destroy_read_struct(&png_ptr, (png_infopp)NULL, 
(png_infopp)NULL);
++              return NULL;
++      }
+       png_uint_32 i;
++      png_byte bit_depth = png_get_bit_depth(png_ptr, info_ptr);
++      png_byte color_type = png_get_color_type(png_ptr, info_ptr);
++      png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
++      png_uint_32 width = png_get_image_width(png_ptr, info_ptr);
++      png_uint_32 rowbytes = png_get_rowbytes(png_ptr, info_ptr);
++
+       png_bytepp row_pointers;
+       
+       uint8_t* imageBuffer;
+@@ -287,18 +306,6 @@
+       }
+       png->seek(png, 0);
+ 
+-      png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 
NULL, pngError, pngWarn);
+-      if (!png_ptr) {
+-              return NULL;
+-      }
+-
+-      png_infop info_ptr = png_create_info_struct(png_ptr);
+-      if (!info_ptr)
+-      {
+-              png_destroy_read_struct(&png_ptr, (png_infopp)NULL, 
(png_infopp)NULL);
+-              return NULL;
+-      }
+-
+       png_infop end_info = png_create_info_struct(png_ptr);
+       if (!end_info)
+       {
+@@ -318,15 +325,15 @@
+ 
+       png_read_info(png_ptr, info_ptr);
+       
+-      if(info_ptr->bit_depth > 8) {
+-              XLOG(0, "warning: bit depth per channel is greater than 8 (%d). 
Attempting to strip, but image quality will be degraded.\n", 
info_ptr->bit_depth);
++      if(bit_depth > 8) {
++              XLOG(0, "warning: bit depth per channel is greater than 8 (%d). 
Attempting to strip, but image quality will be degraded.\n", bit_depth);
+       }
+       
+-      if(info_ptr->color_type == PNG_COLOR_TYPE_GRAY || info_ptr->color_type 
== PNG_COLOR_TYPE_RGB) {
++      if(color_type == PNG_COLOR_TYPE_GRAY || color_type == 
PNG_COLOR_TYPE_RGB) {
+               XLOG(0, "notice: attempting to add dummy transparency 
channel\n");
+       }
+       
+-      if(info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++      if(color_type == PNG_COLOR_TYPE_PALETTE) {
+               XLOG(0, "notice: attempting to expand palette into full rgb\n");
+       }
+       
+@@ -339,24 +346,24 @@
+       png_read_update_info(png_ptr, info_ptr);
+       
+ 
+-      if(info_ptr->width > 320 || info_ptr->height > 480) {
+-              XLOG(0, "error: dimensions out of range, must be within 
320x480, not %lux%lu\n", info_ptr->width, info_ptr->height);
++      if(width > 320 || height > 480) {
++              XLOG(0, "error: dimensions out of range, must be within 
320x480, not %lux%lu\n", width, height);
+               png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+               return NULL;
+       }
+ 
+-      if(info_ptr->bit_depth != 8) {
+-              XLOG(0, "error: bit depth per channel must be 8 not %d!\n", 
info_ptr->bit_depth);
++      if(bit_depth != 8) {
++              XLOG(0, "error: bit depth per channel must be 8 not %d!\n", 
bit_depth);
+               png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+               return NULL;
+       }
+ 
+-      if(info_ptr->color_type != PNG_COLOR_TYPE_GRAY_ALPHA && 
info_ptr->color_type != PNG_COLOR_TYPE_RGB_ALPHA) {
++      if(color_type != PNG_COLOR_TYPE_GRAY_ALPHA && color_type != 
PNG_COLOR_TYPE_RGB_ALPHA) {
+               XLOG(0, "error: incorrect color type, must be greyscale with 
alpha, or rgb with alpha\n");
+-              if(info_ptr->color_type == PNG_COLOR_TYPE_GRAY || 
info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
++              if(color_type == PNG_COLOR_TYPE_GRAY || color_type == 
PNG_COLOR_TYPE_RGB) {
+                       XLOG(0, "It appears you're missing an alpha channel. 
Add transparency to your image\n");
+               }
+-              if(info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++              if(color_type == PNG_COLOR_TYPE_PALETTE) {
+                       XLOG(0, "This PNG is saved with the palette color type 
rather than ARGB.\n");
+               }
+               png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+@@ -364,10 +371,10 @@
+               return NULL;
+       }
+ 
+-      row_pointers = (png_bytepp) malloc(sizeof(png_bytep) * 
info_ptr->height);
+-      imageBuffer = malloc(info_ptr->height * info_ptr->rowbytes);
+-      for(i = 0; i < info_ptr->height; i++) {
+-              row_pointers[i] = imageBuffer + (info_ptr->rowbytes * i);
++      row_pointers = (png_bytepp) malloc(sizeof(png_bytep) * height);
++      imageBuffer = malloc(height * rowbytes);
++      for(i = 0; i < height; i++) {
++              row_pointers[i] = imageBuffer + (rowbytes * i);
+       }
+ 
+       png_read_image(png_ptr, row_pointers);
+@@ -383,15 +390,15 @@
+       }
+       info = (InfoIBootIM*) (imageFile->data);
+       
+-      info->header.width = (uint16_t) info_ptr->width;
+-      info->header.height = (uint16_t) info_ptr->height;
+-      if(info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
++      info->header.width = (uint16_t) width;
++      info->header.height = (uint16_t) height;
++      if(color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+               info->header.format = IBOOTIM_GREY;
+       } else {
+               info->header.format = IBOOTIM_ARGB;
+       }
+       
+-      imageFile->write(imageFile, imageBuffer, info_ptr->height * 
info_ptr->rowbytes);
++      imageFile->write(imageFile, imageBuffer, height * rowbytes);
+       
+       imageFile->close(imageFile);
+ 


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to