Fix: libpng decoding fails to detect out-of-range bKGD

Cosmin Truta <[email protected]> Sun, 7 Jan 2018 17:24:24 -0500
Newsgroups gmane.comp.graphics.png.devel
Message-ID <CAAoVtZzYT6HpOBAxn9FZENuDDPGzk_pHrghNKE0mvvQ8syorWQ@mail.gmail.com>
Hi,

I had an OptiPNG bug report about an assertion failure occurring
because a bad bKGD sneaked into the PNG internals.

I think this is an accidental omission. The reader code fails to
detect out-of-range bKGD grayscale or truecolor values, but the writer
code is fine.

Here is the bug report (with test image) and the fix. I'm proposing to
patch all the currently-supported libpng versions, if possible.

https://sourceforge.net/p/optipng/bugs/71/

Sincerely,
Cosmin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot