Re: IHDR libpng error on width > 1, 000, 000 pixels

John Bowler <[email protected]> Tue, 22 Oct 2024 08:36:50 -0700
Newsgroups gmane.comp.graphics.png.devel
Message-ID <CAP7U39_Zno_X+maiN=1HiR8-6BbDts5DYZqQMBnzqMCdJ23qbw@mail.gmail.com>
--===============8169175921901024898==
Content-Type: multipart/alternative; boundary="000000000000603bc20625128a9d"

--000000000000603bc20625128a9d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 22, 2024 at 6:17=E2=80=AFAM s.samociuk via png-mng-implement <
png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> wrote:

> libpng warning: Image width exceeds user limit in IHDR libpng error:
> Invalid IHDR data Aborted (core dumped)
>
You didn't set up an error handler, which is fine if you want your program
to do SIGABRT when an error is detected.

You control the width/height limit at run time by calling
*png_set_user_limits*.  If you didn't build libpng yourself the
default values can be found in *pnglibconf.h* in the
*PNG_USER_{HEIGHT,WIDTH}_MAX* #defines.  The value in the
PNG file is a PNG unsigned integer so it can't exceed 2,147,483,647

If you build libpng the default value is configured in *pngusr.dfa*  That's
a sample file which shows some of the
security related limits but you can set the above ones there too.

John Bowler

--000000000000603bc20625128a9d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Tue, Oct 22, 2024 at 6:17=E2=80=AFAM s=
.samociuk via png-mng-implement &lt;<a href=3D"mailto:png-mng-implement@lis=
ts.sourceforge.net">png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org</a>&gt; wrote:<=
br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><u></u>

 =20

   =20
 =20
  <div>
    <div style=3D"margin:0px;padding:0px;border:0px;font-style:normal;font-=
variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inhe=
rit;font-variant-east-asian:inherit;font-variant-alternates:inherit;font-we=
ight:400;font-stretch:inherit;font-family:-apple-system,BlinkMacSystemFont,=
&quot;Segoe UI Adjusted&quot;,&quot;Segoe UI&quot;,&quot;Liberation Sans&qu=
ot;,sans-serif;font-kerning:inherit;font-feature-settings:inherit;vertical-=
align:baseline;box-sizing:inherit;width:583.219px;color:rgb(12,13,14);lette=
r-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-s=
pacing:0px;white-space:normal;background-color:rgb(255,255,255);text-decora=
tion-style:initial;text-decoration-color:initial">
      <p style=3D"margin:0px 0px 1.1em;padding:0px;border:0px;font-style:in=
herit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-he=
ight:inherit;font-family:inherit;font-kerning:inherit;font-feature-settings=
:inherit;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:bo=
th"><span style=3D"font-family:inherit;font-style:inherit;font-variant-liga=
tures:inherit;font-variant-caps:inherit;font-weight:inherit">libpng
        warning: Image width exceeds user limit in IHDR libpng error:
        Invalid IHDR data Aborted (core dumped)</span></p></div></div></blo=
ckquote><div>You didn&#39;t set up an error handler, which is fine if you w=
ant your program to do SIGABRT when an error is detected.</div><div><br></d=
iv><div>You control the width/height limit at run time by calling <b>png_se=
t_user_limits</b>.=C2=A0 If you didn&#39;t build libpng yourself the</div><=
div>default values can be found in <b>pnglibconf.h</b> in the <b>PNG_USER_{=
HEIGHT,WIDTH}_MAX</b> #defines.=C2=A0 The value in the</div><div>PNG file i=
s a PNG unsigned integer so it can&#39;t exceed=C2=A02,147,483,647</div><di=
v><br></div><div>If you build libpng the default value is configured in <b>=
pngusr.dfa</b>=C2=A0 That&#39;s a sample file which shows some of the</div>=
<div>security related limits but you can set the above ones there too.</div=
><div><br></div><div>John Bowler</div><div><br></div><div><br></div></div><=
/div>

--000000000000603bc20625128a9d--


--===============8169175921901024898==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8169175921901024898==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
png-mng-implement mailing list
png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

--===============8169175921901024898==--