Bug 35924

Summary: pnmtopng crashes
Product: [Retired] Red Hat Linux Reporter: Han-Wen Nienhuys <hanwen>
Component: netpbmAssignee: Phil Knirsch <pknirsch>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-04-18 11:46:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

blauw:~/usr/src/lilypond$ cat pngcrash.pnm
P5
0 0
255
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