openbsd-ports/games/eboard/patches/patch-cimg_cc
naddy 8c18b08ac5 Fix build with png-1.5.
All fixes from/via NetBSD pkgsrc.  The people there did a lot of
heavy lifting.
2011-07-08 20:36:09 +00:00

27 lines
813 B
Plaintext

$OpenBSD: patch-cimg_cc,v 1.1 2011/07/08 20:36:09 naddy Exp $
Fix build with png-1.5.
--- cimg.cc.orig Wed May 23 12:57:45 2007
+++ cimg.cc Tue Jul 5 23:44:41 2011
@@ -95,16 +95,16 @@ CImg::CImg(const char *filename) {
ct == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(pngp);
- alloc(pngp->width,pngp->height);
+ alloc(png_get_image_width(pngp, infp),png_get_image_height(pngp, infp));
if (!ok) { fclose(f); return; }
ok = 0;
- rp = (png_bytep *) malloc(sizeof(png_bytep) * (pngp->height));
+ rp = (png_bytep *) malloc(sizeof(png_bytep) * (png_get_image_height(pngp, infp)));
if (rp==NULL) {
fclose(f); return;
}
- for(i=0;i<pngp->height;i++) {
+ for(i=0;i<png_get_image_height(pngp, infp);i++) {
png_read_row(pngp, (png_bytep) (&data[i*rowlen]), NULL);
}