[PATCH] Fix example calls to png_set_rows() in the manual
Hussam al-Homsi <[email protected]> Mon, 3 Jan 2022 20:40:36 -0500
| Newsgroups | gmane.comp.graphics.png.devel |
|---|---|
| Message-ID | <CAJebAKuTR5h5kKDBRkMR7hy3SZ7Y8t8MM4bSzenxTtf95YibtQ@mail.gmail.com> |
The third parameter of png_set_rows() is a pointer to pointer but the given argument is &row_pointers, which is a pointer to an array of pointer. The attached patch fixes this. _______________________________________________ png-mng-implement mailing list png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/png-mng-implement
Fix-example-calls-to-png_set_rows-in-the-manual.patch
(text/x-patch, 1.3 KB)
From d86ab6632fb2521c0a8d359c23b17d26f96412ab Mon Sep 17 00:00:00 2001 From: Hussam al-Homsi <[email protected]> Date: Mon, 3 Jan 2022 19:40:49 -0500 Subject: [PATCH] Fix example calls to png_set_rows() in the manual Signed-off-by: Hussam al-Homsi <[email protected]> --- libpng-manual.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpng-manual.txt b/libpng-manual.txt index 5dad92fbf..569c2248b 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1198,7 +1198,7 @@ row_pointers prior to calling png_read_png() with row_pointers[i]=png_malloc(png_ptr, width*pixel_size); - png_set_rows(png_ptr, info_ptr, &row_pointers); + png_set_rows(png_ptr, info_ptr, row_pointers); Alternatively you could allocate your image in one big block and define row_pointers[i] to point into the proper places in your block, but first @@ -1214,7 +1214,7 @@ be sure that your platform is able to allocate such a large buffer: for (int i=0; i<height, i++) row_pointers[i]=buffer+i*width*pixel_size; - png_set_rows(png_ptr, info_ptr, &row_pointers); + png_set_rows(png_ptr, info_ptr, row_pointers); If you use png_set_rows(), the application is responsible for freeing row_pointers (and row_pointers[i], if they were separately allocated). -- 2.30.2