| OLD | NEW |
| 1 | 1 |
| 2 /* pngrutil.c - utilities to read a PNG file | 2 /* pngrutil.c - utilities to read a PNG file |
| 3 * | 3 * |
| 4 * Last changed in libpng 1.2.44 [June 26, 2010] | 4 * Last changed in libpng 1.2.45 [July 7, 2011] |
| 5 * Copyright (c) 1998-2010 Glenn Randers-Pehrson | 5 * Copyright (c) 1998-2011 Glenn Randers-Pehrson |
| 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
| 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
| 8 * | 8 * |
| 9 * This code is released under the libpng license. | 9 * This code is released under the libpng license. |
| 10 * For conditions of distribution and use, see the disclaimer | 10 * For conditions of distribution and use, see the disclaimer |
| 11 * and license in png.h | 11 * and license in png.h |
| 12 * | 12 * |
| 13 * This file contains routines that are only called from within | 13 * This file contains routines that are only called from within |
| 14 * libpng itself during the course of reading an image. | 14 * libpng itself during the course of reading an image. |
| 15 */ | 15 */ |
| (...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 png_crc_finish(png_ptr, length); | 1805 png_crc_finish(png_ptr, length); |
| 1806 return; | 1806 return; |
| 1807 } | 1807 } |
| 1808 else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL)) | 1808 else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL)) |
| 1809 { | 1809 { |
| 1810 png_warning(png_ptr, "Duplicate sCAL chunk"); | 1810 png_warning(png_ptr, "Duplicate sCAL chunk"); |
| 1811 png_crc_finish(png_ptr, length); | 1811 png_crc_finish(png_ptr, length); |
| 1812 return; | 1812 return; |
| 1813 } | 1813 } |
| 1814 | 1814 |
| 1815 /* Need unit type, width, \0, height: minimum 4 bytes */ |
| 1816 else if (length < 4) |
| 1817 { |
| 1818 png_warning(png_ptr, "sCAL chunk too short"); |
| 1819 png_crc_finish(png_ptr, length); |
| 1820 return; |
| 1821 } |
| 1822 |
| 1815 png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)", | 1823 png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)", |
| 1816 length + 1); | 1824 length + 1); |
| 1817 png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); | 1825 png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); |
| 1818 if (png_ptr->chunkdata == NULL) | 1826 if (png_ptr->chunkdata == NULL) |
| 1819 { | 1827 { |
| 1820 png_warning(png_ptr, "Out of memory while processing sCAL chunk"); | 1828 png_warning(png_ptr, "Out of memory while processing sCAL chunk"); |
| 1821 png_crc_finish(png_ptr, length); | 1829 png_crc_finish(png_ptr, length); |
| 1822 return; | 1830 return; |
| 1823 } | 1831 } |
| 1824 slength = (png_size_t)length; | 1832 slength = (png_size_t)length; |
| (...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3373 png_debug1(3, "height = %lu,", png_ptr->height); | 3381 png_debug1(3, "height = %lu,", png_ptr->height); |
| 3374 png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); | 3382 png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); |
| 3375 png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); | 3383 png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); |
| 3376 png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); | 3384 png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); |
| 3377 png_debug1(3, "irowbytes = %lu", | 3385 png_debug1(3, "irowbytes = %lu", |
| 3378 PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); | 3386 PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); |
| 3379 | 3387 |
| 3380 png_ptr->flags |= PNG_FLAG_ROW_INIT; | 3388 png_ptr->flags |= PNG_FLAG_ROW_INIT; |
| 3381 } | 3389 } |
| 3382 #endif /* PNG_READ_SUPPORTED */ | 3390 #endif /* PNG_READ_SUPPORTED */ |
| OLD | NEW |