List Info

Thread: extra IDATs




extra IDATs
user name
2006-05-24 22:37:03
hello

from pngread.c:
      else if (!png_memcmp(png_ptr->chunk_name, png_IDAT,
4))
      {
         /* Zero length IDATs are legal after the last IDAT
has been
          * read, but not after other chunks have been read.
          */
         if (length > 0 || png_ptr->mode &
PNG_AFTER_IDAT)
            png_error(png_ptr, "Too many IDAT's
found");

shouldn't that be an && instead of ||?

does the png spec actually require this check? i can't find
that clause 
in http://www.w3.org/TR/PNG/

i was hoping that it won't complain about extra IDATs but
now it doesn't 
matter much, since backwards compatibility is critical to my
app.

cheers


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the
Cost and Risk!
Fully trained technicians. The highest number of Red Hat
certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
png-mng-implement mailing list
png-mng-implementlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/png-m
ng-implement
extra IDATs
user name
2006-05-25 01:00:08
From: Andrew Smith
>from pngread.c:
>      else if (!png_memcmp(png_ptr->chunk_name,
png_IDAT, 4))
>      {
>         /* Zero length IDATs are legal after the last
IDAT has been
>          * read, but not after other chunks have been
read.
>          */
>         if (length > 0 || png_ptr->mode &
PNG_AFTER_IDAT)
>            png_error(png_ptr, "Too many IDAT's
found");
>
>shouldn't that be an && instead of ||?

The code is in png_read_end, it's correct if png_read_end
is only called
after all the (non-0 length) IDAT chunks have been read.  A
zero length
IDAT is valid anywhere an IDAT is valid, but all IDATs must
be
contiguous.  IIRC PNG_AFTER_IDAT is set when the first
non-IDAT chunk
is seen after an IDAT, so the above png_error fires on
(either) an
IDAT after some other non-IDAT chunk or on a non-zero length
IDAT.

>i was hoping that it won't complain about extra IDATs
but now it doesn't 
>matter much, since backwards compatibility is critical
to my app.

I believe the code doesn't care about zero length IDAT (and
that it
shouldn't).

John Bowler <jbowleracm.org>



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the
Cost and Risk!
Fully trained technicians. The highest number of Red Hat
certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
png-mng-implement mailing list
png-mng-implementlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/png-m
ng-implement
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )