[hackers] [farbfeld] Fix gcc-optimization bug in png2ff || FRIGN
commit 42ace91b3ddba2fa40e0362ce7aba814aa7dd79c
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Sun Jan 17 21:01:50 2016 +0100
Commit: FRIGN <dev_AT_frign.de>
CommitDate: Sun Jan 17 21:01:50 2016 +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...
diff --git a/png2ff.c b/png2ff.c
index aea7a50..97bcdce 100644
--- a/png2ff.c
+++ b/png2ff.c
_AT_@ -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;
_AT_@ -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;
Received on Sun Jan 17 2016 - 21:04:23 CET
This archive was generated by hypermail 2.3.0
: Sun Jan 17 2016 - 21:12:17 CET