| 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.45 [July 7, 2011] | 4 * Last changed in libpng 1.2.45 [July 7, 2011] |
| 5 * Copyright (c) 1998-2011 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 |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 else if (png_ptr->mode & PNG_HAVE_IDAT) | 691 else if (png_ptr->mode & PNG_HAVE_IDAT) |
| 692 { | 692 { |
| 693 png_warning(png_ptr, "Invalid gAMA after IDAT"); | 693 png_warning(png_ptr, "Invalid gAMA after IDAT"); |
| 694 png_crc_finish(png_ptr, length); | 694 png_crc_finish(png_ptr, length); |
| 695 return; | 695 return; |
| 696 } | 696 } |
| 697 else if (png_ptr->mode & PNG_HAVE_PLTE) | 697 else if (png_ptr->mode & PNG_HAVE_PLTE) |
| 698 /* Should be an error, but we can cope with it */ | 698 /* Should be an error, but we can cope with it */ |
| 699 png_warning(png_ptr, "Out of place gAMA chunk"); | 699 png_warning(png_ptr, "Out of place gAMA chunk"); |
| 700 | 700 |
| 701 #ifdef CHROME_PNG_READ_iCCP_sRGB_cHRM_gAMA |
| 702 if (info_ptr != NULL) |
| 703 info_ptr->chroma_or_gamma |= PNG_INFO_gAMA; |
| 704 #endif |
| 705 |
| 701 if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) | 706 if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) |
| 702 #ifdef PNG_READ_sRGB_SUPPORTED | 707 #ifdef PNG_READ_sRGB_SUPPORTED |
| 703 && !(info_ptr->valid & PNG_INFO_sRGB) | 708 && !(info_ptr->valid & PNG_INFO_sRGB) |
| 704 #endif | 709 #endif |
| 705 ) | 710 ) |
| 706 { | 711 { |
| 707 png_warning(png_ptr, "Duplicate gAMA chunk"); | 712 png_warning(png_ptr, "Duplicate gAMA chunk"); |
| 708 png_crc_finish(png_ptr, length); | 713 png_crc_finish(png_ptr, length); |
| 709 return; | 714 return; |
| 710 } | 715 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 else if (png_ptr->mode & PNG_HAVE_IDAT) | 846 else if (png_ptr->mode & PNG_HAVE_IDAT) |
| 842 { | 847 { |
| 843 png_warning(png_ptr, "Invalid cHRM after IDAT"); | 848 png_warning(png_ptr, "Invalid cHRM after IDAT"); |
| 844 png_crc_finish(png_ptr, length); | 849 png_crc_finish(png_ptr, length); |
| 845 return; | 850 return; |
| 846 } | 851 } |
| 847 else if (png_ptr->mode & PNG_HAVE_PLTE) | 852 else if (png_ptr->mode & PNG_HAVE_PLTE) |
| 848 /* Should be an error, but we can cope with it */ | 853 /* Should be an error, but we can cope with it */ |
| 849 png_warning(png_ptr, "Missing PLTE before cHRM"); | 854 png_warning(png_ptr, "Missing PLTE before cHRM"); |
| 850 | 855 |
| 856 #ifdef CHROME_PNG_READ_iCCP_sRGB_cHRM_gAMA |
| 857 if (info_ptr != NULL) |
| 858 info_ptr->chroma_or_gamma |= PNG_INFO_cHRM; |
| 859 #endif |
| 860 |
| 851 if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM) | 861 if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM) |
| 852 #ifdef PNG_READ_sRGB_SUPPORTED | 862 #ifdef PNG_READ_sRGB_SUPPORTED |
| 853 && !(info_ptr->valid & PNG_INFO_sRGB) | 863 && !(info_ptr->valid & PNG_INFO_sRGB) |
| 854 #endif | 864 #endif |
| 855 ) | 865 ) |
| 856 { | 866 { |
| 857 png_warning(png_ptr, "Duplicate cHRM chunk"); | 867 png_warning(png_ptr, "Duplicate cHRM chunk"); |
| 858 png_crc_finish(png_ptr, length); | 868 png_crc_finish(png_ptr, length); |
| 859 return; | 869 return; |
| 860 } | 870 } |
| (...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3388 png_debug1(3, "height = %lu,", png_ptr->height); | 3398 png_debug1(3, "height = %lu,", png_ptr->height); |
| 3389 png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); | 3399 png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); |
| 3390 png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); | 3400 png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); |
| 3391 png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); | 3401 png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); |
| 3392 png_debug1(3, "irowbytes = %lu", | 3402 png_debug1(3, "irowbytes = %lu", |
| 3393 PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); | 3403 PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); |
| 3394 | 3404 |
| 3395 png_ptr->flags |= PNG_FLAG_ROW_INIT; | 3405 png_ptr->flags |= PNG_FLAG_ROW_INIT; |
| 3396 } | 3406 } |
| 3397 #endif /* PNG_READ_SUPPORTED */ | 3407 #endif /* PNG_READ_SUPPORTED */ |
| OLD | NEW |