Bug 35924 - pnmtopng crashes
Summary: pnmtopng crashes
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: netpbm
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2001-04-14 13:04 UTC by Han-Wen Nienhuys
Modified: 2015-03-05 01:09 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2001-04-18 11:46:59 UTC

Attachments (Terms of Use)

Description Han-Wen Nienhuys 2001-04-14 13:04:32 UTC
pnmtopng crashes on zero-sized pictures:

blauw:~/usr/src/lilypond$ cat pngcrash.pnm
0 0
blauw:~/usr/src/lilypond$ pnmtopng < pngcrash.pnm  > /dev/null
pnmtopng:  fatal libpng error: No IDATs written into file
pnmtopng: setjmp returns error condition (2)

Comment 1 Phil Knirsch 2001-04-18 11:46:55 UTC
Looking into it...

Read ya, Phil

Comment 2 Phil Knirsch 2001-04-23 13:58:30 UTC
OK, after checking some documents and the libpng itself it seems as if PNG
doesn't support 0x0 sized images.

So the correct answer is that the input is already bogous. What could be done is
to ignore the conversion of such an image and display an error message (which
i'll do for the next release), but there is no sane way to convert such a valid
PNM picture into a PNG image.

To test it i hacked a modified version of pnmtopng where i output a empty IDAT
block into the file if there image is 0x0 pixels, and no program can read that
picture afterwards and complains about an invalid PNG image size.

Hope this clarifies the situation.

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.