[libpng16] Changed png_memcpy to C assignment where appropriate. Changed all

those uses of png_memcpy that were doing a simple assignment to assignments
(all those cases where the thing being copied is a non-array C L-value.)
Added some error checking to png_set_*() routines and removed the
reference to the non-exported function png_memcpy() from example.c. Fixed
the Visual C 64-bit build - it requires jmp_buf to be aligned, but it had
become misaligned.
This commit is contained in:
John Bowler
2011-12-28 21:34:27 -06:00
committed by Glenn Randers-Pehrson
parent 4f67e40898
commit fcd301daed
7 changed files with 87 additions and 50 deletions

View File

@@ -97,7 +97,7 @@ png_set_background_fixed(png_structrp png_ptr,
{
png_debug(1, "in png_set_background_fixed");
if (png_ptr == NULL)
if (png_ptr == NULL || background_color == NULL)
return;
if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
@@ -110,8 +110,7 @@ png_set_background_fixed(png_structrp png_ptr,
png_ptr->transformations &= ~PNG_ENCODE_ALPHA;
png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA;
png_memcpy(&(png_ptr->background), background_color,
png_sizeof(png_color_16));
png_ptr->background = *background_color;
png_ptr->background_gamma = background_gamma;
png_ptr->background_gamma_type = (png_byte)(background_gamma_code);
if (need_expand)