| OLD | NEW |
| 1 | 1 |
| 2 /* pngread.c - read a PNG file | 2 /* pngread.c - read a PNG file |
| 3 * | 3 * |
| 4 * Last changed in libpng 1.2.52 [November 20, 2014] | 4 * Last changed in libpng 1.2.53 [February 26, 2015] |
| 5 * Copyright (c) 1998-2014 Glenn Randers-Pehrson | 5 * Copyright (c) 1998-2015 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 an application calls directly to | 13 * This file contains routines that an application calls directly to |
| 14 * read a PNG file or stream. | 14 * read a PNG file or stream. |
| 15 */ | 15 */ |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 int i = 0; | 268 int i = 0; |
| 269 | 269 |
| 270 png_structp png_ptr=*ptr_ptr; | 270 png_structp png_ptr=*ptr_ptr; |
| 271 | 271 |
| 272 if (png_ptr == NULL) | 272 if (png_ptr == NULL) |
| 273 return; | 273 return; |
| 274 | 274 |
| 275 do | 275 do |
| 276 { | 276 { |
| 277 if (user_png_ver[i] != png_libpng_ver[i]) | 277 if (user_png_ver == NULL || user_png_ver[i] != png_libpng_ver[i]) |
| 278 { | 278 { |
| 279 #ifdef PNG_LEGACY_SUPPORTED | 279 #ifdef PNG_LEGACY_SUPPORTED |
| 280 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; | 280 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; |
| 281 #else | 281 #else |
| 282 png_ptr->warning_fn = NULL; | 282 png_ptr->warning_fn = NULL; |
| 283 png_warning(png_ptr, | 283 png_warning(png_ptr, |
| 284 "Application uses deprecated png_read_init() and should be" | 284 "Application uses deprecated png_read_init() and should be" |
| 285 " recompiled."); | 285 " recompiled."); |
| 286 break; | 286 break; |
| 287 #endif | 287 #endif |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 return; | 590 return; |
| 591 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) | 591 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) |
| 592 png_read_start_row(png_ptr); | 592 png_read_start_row(png_ptr); |
| 593 } | 593 } |
| 594 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ | 594 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ |
| 595 | 595 |
| 596 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED | 596 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED |
| 597 void PNGAPI | 597 void PNGAPI |
| 598 png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) | 598 png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) |
| 599 { | 599 { |
| 600 #ifndef PNG_USE_GLOBAL_ARRAYS |
| 600 PNG_CONST PNG_IDAT; | 601 PNG_CONST PNG_IDAT; |
| 601 PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, | 602 PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, |
| 602 0xff}; | 603 0xff}; |
| 603 PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; | 604 PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; |
| 605 #endif |
| 604 int ret; | 606 int ret; |
| 605 | 607 |
| 606 if (png_ptr == NULL) | 608 if (png_ptr == NULL) |
| 607 return; | 609 return; |
| 608 | 610 |
| 609 png_debug2(1, "in png_read_row (row %lu, pass %d)", | 611 png_debug2(1, "in png_read_row (row %lu, pass %d)", |
| 610 png_ptr->row_number, png_ptr->pass); | 612 png_ptr->row_number, png_ptr->pass); |
| 611 | 613 |
| 612 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) | 614 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) |
| 613 png_read_start_row(png_ptr); | 615 png_read_start_row(png_ptr); |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ | 1508 /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ |
| 1507 png_read_end(png_ptr, info_ptr); | 1509 png_read_end(png_ptr, info_ptr); |
| 1508 | 1510 |
| 1509 PNG_UNUSED(transforms) /* Quiet compiler warnings */ | 1511 PNG_UNUSED(transforms) /* Quiet compiler warnings */ |
| 1510 PNG_UNUSED(params) | 1512 PNG_UNUSED(params) |
| 1511 | 1513 |
| 1512 } | 1514 } |
| 1513 #endif /* PNG_INFO_IMAGE_SUPPORTED */ | 1515 #endif /* PNG_INFO_IMAGE_SUPPORTED */ |
| 1514 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ | 1516 #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ |
| 1515 #endif /* PNG_READ_SUPPORTED */ | 1517 #endif /* PNG_READ_SUPPORTED */ |
| OLD | NEW |