[Pkg-fonts-devel] Bug#649950: Bug#649950: fontforge: FTBFS: gimagewritepng.c:339:12: error: dereferencing pointer to incomplete type

Daniel Kahn Gillmor dkg at debian.org
Mon Nov 28 22:29:45 UTC 2011

[re: http://bugs.debian.org/649950]

On Fri, 25 Nov 2011 08:52:05 +0900, Nobuhiro Iwamatsu <iwamatsu at nigauri.org> wrote:
> I uploaded libpng 1.5.2 to experimental.
> libpng maintainers plan to transition from libpng 1.2 to 1.5.
> I am checking build it the package depend to libpng.
> I noticed your package FTBFS by libpng 1.5.

Thanks for the report, Nobuhiro!

i just looked into this.  All these errors:

gimagewritepng.c:339:12: error: dereferencing pointer to incomplete type
gimagewritepng.c:340:12: error: dereferencing pointer to incomplete type
gimagewritepng.c:341:12: error: dereferencing pointer to incomplete type
gimagewritepng.c:342:12: error: dereferencing pointer to incomplete type

come from dereferences to info_ptr, defined as:

    png_infop info_ptr;

But png.h from libpng1.5 says:

/* The complete definition of png_info has, as of libpng-1.5.0,
 * been moved into a separate header file that is not accessible to
 * applications.  Read libpng-manual.txt or libpng.3 for more info.

(see more discussion on fontforge-devel [0])

It looks to me like blocks like this (from gutils/gimagewritepng.c):

   info_ptr->width = base->width;
   info_ptr->height = base->height;
   info_ptr->bit_depth = 8;
   info_ptr->valid = 0;
   info_ptr->interlace_type = progressive;
   if ( base->trans!=-1 ) {
       info_ptr->num_trans = 1;
       info_ptr->valid |= PNG_INFO_tRNS;

Will need to be replaced with blocks like:

   _png_set_IHDR(png_ptr, info_ptr, base->width, base->height,
                 bit_depth, color_type, progressive,

and so forth.

Interestingly, the latter style of block is already present in the same
file.  It appears to be just the definition of GImageWrite_Png() in
gutils/gimagewritepng.c that is causing these errors, since commenting
out the contents of that function allows the rest of fontforge to
compile to the end.

fontforge isn't swapped into my head enough right now to be able to
produce a patch that fixes the issue, but it's less than a hundred lines
of code (all in a single function) which needs translation to indirect
access to the info_ptr object.



[0] http://thread.gmane.org/gmane.comp.fonts.fontforge.devel/7292/focus=2460
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 965 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-fonts-devel/attachments/20111128/708f0ef5/attachment.pgp>

More information about the Pkg-fonts-devel mailing list