9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: andrey mirtchovski <mirtchov@cpsc.ucalgary.ca>
To: 9fans@cse.psu.edu
Subject: [9fans] inflatezlib/readpng bug
Date: Fri, 18 Jul 2003 19:48:46 -0600	[thread overview]
Message-ID: <Pine.LNX.4.44.0307181929280.10332-100000@fbsd.cpsc.ucalgary.ca> (raw)

I can't catch this one. Having spent the afternoon trying to hunt it, I'll
report it without a fix, sorry.

The bug is, basically, png(1) can't display png images larger than 0x8000
bytes (+ headers).

To illustrate the bug try on your machine:

	resample -x 1024 -y 1024 /lib/face/48x48x4/g/glenda.1 | topng | png

you will get a 'header said 1024 rows; data goes further' error message.


If, however, the png images are smaller than 0x8000 (like the normal
glenda image, or even resampled at 512x512) png displays them fine. The
number 0x8000(+headers) is significant, because that's the chunk size
that inflate() in libflate will process in a single run. With compressed
images larger than that inflatezlib()'s (readpng uses inflatezlib() which
calls inflate()) write/read functions will be called more than once and the
bug will be triggered.

Note that deflatezlib() used by topng works fine -- large images created
with it are read fine everywhere else.

Why do I think it's the library and not png.c itself? If you change png.c
and topng.c to use inflate/deflate instead of inflatezlib/deflatezlib,
leaving everything else intacs, the example above will succeed.

andrey



                 reply	other threads:[~2003-07-19  1:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0307181929280.10332-100000@fbsd.cpsc.ucalgary.ca \
    --to=mirtchov@cpsc.ucalgary.ca \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).