9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "adr via 9fans" <9fans@9fans.net>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] pngread: alloc chunk's length
Date: Mon, 12 Jul 2021 23:31:49 +0000 (UTC)	[thread overview]
Message-ID: <6c633170-ba92-52f4-5244-28fa6c7302b@SDF.ORG> (raw)
In-Reply-To: <CAFSF3XOoQTK6AVssQvdQAs8XujZ6Z0X-qJAkeGH0sQ5QoxDaBg@mail.gmail.com>

On Mon, 12 Jul 2021, hiro wrote:

> Date: Mon, 12 Jul 2021 20:04:23 +0200
> From: hiro <23hiro@gmail.com>
> Reply-To: 9fans <9fans@9fans.net>
> To: 9fans <9fans@9fans.net>
> Subject: Re: [9fans] pngread: alloc chunk's length
> 
> it's always useful to have the testcase available, for others and for
> possible future regressions

There is nothing to test, really, the length of an IDAT chunk
can't be fixed (At least you want to allocate more than 2GB...)
If a png file has a IDAT bigger than your constant, you are screwed.

You haven't noticed because the majority of encoders use small
chunks, but that doesn't mean that the code is right, is not. If
you want to test with a png file anyway, take a big image and use
some tool like
   http://optipng.sourceforge.net

The resulting file will be possibly smaller, but the data stream will
be encoded in one IDAT chunk to save space and reduce the overhead
of processing numerous IDAT chunks.

But you'll just get

getchunk needed xxxxxxxx, had 1000000

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T4a714ed14c50767a-Mcaf942981401d70c27d13d7e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

  reply	other threads:[~2021-07-12 23:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 21:28 adr via 9fans
2021-07-10 21:49 ` adr via 9fans
2021-07-12 12:53   ` ori
2021-07-12 16:28     ` adr via 9fans
2021-07-12 16:01 ` ori
2021-07-12 17:01   ` adr via 9fans
2021-07-12 18:04     ` hiro
2021-07-12 23:31       ` adr via 9fans [this message]
2021-07-12 23:49         ` adr via 9fans
2021-07-13  8:16           ` hiro
2021-07-13  9:40             ` adr via 9fans
2021-07-13  9:46               ` hiro
2021-07-13 12:04                 ` adr via 9fans
2021-07-13 12:11                 ` adr via 9fans
2021-07-14 15:52     ` ori
2021-07-14 17:05       ` adr via 9fans

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=6c633170-ba92-52f4-5244-28fa6c7302b@SDF.ORG \
    --to=9fans@9fans.net \
    /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).