pnggroup / libpng

LIBPNG: Portable Network Graphics support, official libpng repository
http://libpng.sf.net
Other
1.27k stars 620 forks source link

pngtest creates output image with incorrect filename in relaxed mode #420

Open agoodm88 opened 2 years ago

agoodm88 commented 2 years ago

The testpng example application I believe should take input and output filenames as arguments. However when ran in --relaxed mode outfile argument is ignored:

For example:

alan@fuzz:~$ rm -f pngout.png alan@fuzz:~$ ls | grep -c pngout.png 0 alan@fuzz:~$ ./libpng_afl/pngtest black1x1.png >/dev/null alan@fuzz:~$ ls | grep -c pngout.png 1 alan@fuzz:~$ rm -f pngout.png alan@fuzz:~$ ./libpng_afl/pngtest black1x1.png pngout1.png >/dev/null alan@fuzz:~$ ls | grep -c pngout.png 0 alan@fuzz:~$ ./libpng_afl/pngtest --relaxed black1x1.png pngout1.png >/dev/null alan@fuzz:~$ ls | grep -c pngout.png 1

Expected outcome is outfilename should be honored even in relaxed mode.

jbowler commented 1 year ago

It is, in fact, a test program which only works with certain arguments and even then doesn't do anything logical with those arguments. I ran into the same issue myself just a couple of days ago; pngout.png always used to be a correctly formed PNG file, but with --relaxed (which is what the last test in "make check" uses) it is garbage.

pngtest has no function other than to run the very specific tests in "make check". It does that. This is not a bug.

jbowler commented 6 days ago

@ctruta, @agoodm88 please close. @agoodm88 use one of the other test programs instead. pngimage is normally a good bet, or you could try pngstest.