Fix an off-by-one error in `png_do_check_palette_indexes`
The last byte of each row was ignored in a function that was executed
under the build flags `PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED` and
`PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED`.
This is a revert of a change previously applied in libpng-1.6.33beta01.
See SourceForge bug #269 at https://sourceforge.net/p/libpng/bugs/269/
Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
diff --git a/AUTHORS b/AUTHORS
index 66d9201..c98d522 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -4,6 +4,7 @@
This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes.
+ * Adam Richter
* Andreas Dilger
* Cosmin Truta
* Dave Martindale
diff --git a/pngtrans.c b/pngtrans.c
index 1100f46..7093451 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -708,7 +708,7 @@
* forms produced on either GCC or MSVC.
*/
int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
- png_bytep rp = png_ptr->row_buf + row_info->rowbytes - 1;
+ png_bytep rp = png_ptr->row_buf + row_info->rowbytes;
switch (row_info->bit_depth)
{