Fix build with png-1.5.
This commit is contained in:
parent
aa44c67cc2
commit
533d222f78
2 changed files with 28 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
$NetBSD: distinfo,v 1.5 2008/02/06 08:53:29 rillig Exp $
|
||||
$NetBSD: distinfo,v 1.6 2011/04/03 10:35:58 wiz Exp $
|
||||
|
||||
SHA1 (eboard-1.0.4.tar.bz2) = 44938754140043fc64143e91067c95b6c5c99709
|
||||
RMD160 (eboard-1.0.4.tar.bz2) = f12b0927ca848418eb45a75bcff8a641766ae33c
|
||||
Size (eboard-1.0.4.tar.bz2) = 453603 bytes
|
||||
SHA1 (patch-cimg.cc) = 7a5b4652f9a2f0fdeacd442e5da7b71402046107
|
||||
|
|
26
games/eboard/patches/patch-cimg.cc
Normal file
26
games/eboard/patches/patch-cimg.cc
Normal file
|
@ -0,0 +1,26 @@
|
|||
$NetBSD: patch-cimg.cc,v 1.1 2011/04/03 10:35:58 wiz Exp $
|
||||
|
||||
Fix build with png-1.5.
|
||||
|
||||
--- cimg.cc.orig 2007-05-23 18:57:45.000000000 +0000
|
||||
+++ cimg.cc
|
||||
@@ -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);
|
||||
}
|
||||
|
Loading…
Reference in a new issue