diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2016-06-23 10:58:24 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2016-06-23 11:08:06 -0500 |
commit | 4b4a9583b45c0344779344d17f3c84f75463233b (patch) | |
tree | 6e04a341bf09585bd852f9603812d5648b7c1267 /pngwutil.c | |
parent | da2ba024a53abaa8f87783aed54416b2b22ffc06 (diff) |
[libpng16] Imported from libpng-1.6.24beta02.tar
Diffstat (limited to 'pngwutil.c')
-rw-r--r-- | pngwutil.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pngwutil.c b/pngwutil.c index 665464be1..c1751fe5a 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -2448,7 +2448,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) /* Overflow can occur in the calculation, just select the lowest set * filter. */ - filter_to_do &= 0U-filter_to_do; + filter_to_do &= -filter_to_do; } else if ((filter_to_do & PNG_FILTER_NONE) != 0 && filter_to_do != PNG_FILTER_NONE) @@ -2477,7 +2477,9 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) /* It's the only filter so no testing is needed */ { /* Passing PNG_SIZE_MAX here and below prevents the 'setup' function - * breaking out of the loop when lmins is exceeded. + * breaking out of the loop when lmins is exceeded. Optimizing + * compilers should notice that we don't use the returned sum, and + * therefore 'setup' should refrain from calculating and returning "sum". */ (void) png_setup_sub_row(png_ptr, bpp, row_bytes, PNG_SIZE_MAX); best_row = png_ptr->try_row; |