farbfeld

suckless image format with conversion tools
git clone git://git.suckless.org/farbfeld
Log | Files | Refs | README | LICENSE

commit 42ace91b3ddba2fa40e0362ce7aba814aa7dd79c
parent 853b79b67c81735874acaeeab5293e9dd7af06bb
Author: FRIGN <dev@frign.de>
Date:   Sun, 17 Jan 2016 21:01:50 +0100

Fix gcc-optimization bug in png2ff

For some reason, those strange png_char_pp-passes were optimized away
in some way, yielding in icc_len = 0.
I now explicitly use the pointers to indicate to the compiler that we
pass by reference. Fuck those png types...

Diffstat:
png2ff.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/png2ff.c b/png2ff.c @@ -35,8 +35,8 @@ main(int argc, char *argv[]) cmsToneCurve *gamma18, *out_curves[3]; png_structp png_struct_p; png_infop png_info_p; - png_bytepp png_row_p, icc_data = NULL; - png_charpp icc_name = NULL; + png_bytep *png_row_p, icc_data; + png_charp icc_name; uint32_t width, height, icc_len, outrowlen, tmp32, r, i; uint16_t *inrow, *outrow; int icc_compression; @@ -72,8 +72,8 @@ main(int argc, char *argv[]) /* icc profile (output ProPhoto RGB) */ if (png_get_valid(png_struct_p, png_info_p, PNG_INFO_iCCP)) { - png_get_iCCP(png_struct_p, png_info_p, icc_name, - &icc_compression, icc_data, &icc_len); + png_get_iCCP(png_struct_p, png_info_p, &icc_name, + &icc_compression, &icc_data, &icc_len); if (!(in_profile = cmsOpenProfileFromMem(icc_data, icc_len))) goto lcmserr;