diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2015-02-18 12:24:46 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2015-02-18 12:24:46 -0600 |
commit | 60a7506744a296ff1a42c41fc952f7ae8b875b4b (patch) | |
tree | 1155a6fef8bedf8a028783f4a93457e72023d040 /pngget.c | |
parent | d3ff44f0d50f9121a0b0e78c3a3c3dce3db9631f (diff) | |
download | libpng-60a7506744a296ff1a42c41fc952f7ae8b875b4b.tar.gz |
[libpng16]Allow calling png_get_IHDR() with NULL arguments (Reuben Hawkins).
Diffstat (limited to 'pngget.c')
-rw-r--r-- | pngget.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -1,8 +1,8 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.17 [(PENDING RELEASE)] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -799,14 +799,20 @@ png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr, { png_debug1(1, "in %s retrieval function", "IHDR"); - if (png_ptr == NULL || info_ptr == NULL || width == NULL || - height == NULL || bit_depth == NULL || color_type == NULL) + if (png_ptr == NULL || info_ptr == NULL) return (0); - *width = info_ptr->width; - *height = info_ptr->height; - *bit_depth = info_ptr->bit_depth; - *color_type = info_ptr->color_type; + if (width != NULL) + *width = info_ptr->width; + + if (height != NULL) + *height = info_ptr->height; + + if (bit_depth != NULL) + *bit_depth = info_ptr->bit_depth; + + if (color_type != NULL) + *color_type = info_ptr->color_type; if (compression_type != NULL) *compression_type = info_ptr->compression_type; |