mirror of
				https://git.code.sf.net/p/libpng/code.git
				synced 2025-07-10 18:04:09 +02:00 
			
		
		
		
	[libpng17] Check for info_ptr == NULL early in png_read_end() so we don't need
to run all the png_handle_*() and depend on them to return if info_ptr == NULL. This improves the performance of png_read_end(png_ptr, NULL) and makes it more robust against future programming errors.
This commit is contained in:
		
							parent
							
								
									2ced844b0e
								
							
						
					
					
						commit
						848eeacb41
					
				
							
								
								
									
										8
									
								
								ANNOUNCE
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								ANNOUNCE
									
									
									
									
									
								
							| @ -1,5 +1,5 @@ | |||||||
| 
 | 
 | ||||||
| Libpng 1.7.0beta32 - February 16, 2014 | Libpng 1.7.0beta32 - February 17, 2014 | ||||||
| 
 | 
 | ||||||
| This is not intended to be a public release.  It will be replaced | This is not intended to be a public release.  It will be replaced | ||||||
| within a few weeks by a public version or by another test version. | within a few weeks by a public version or by another test version. | ||||||
| @ -533,7 +533,7 @@ Version 1.7.0beta31 [February 6, 2014] | |||||||
|     and it adds corresponding code to pngimage.c to handle such options |     and it adds corresponding code to pngimage.c to handle such options | ||||||
|     by not attempting to test them. |     by not attempting to test them. | ||||||
| 
 | 
 | ||||||
| Version 1.7.0beta32 [February 16, 2014] | Version 1.7.0beta32 [February 17, 2014] | ||||||
|   Moved redefines of png_error(), png_warning(), png_chunk_error(), |   Moved redefines of png_error(), png_warning(), png_chunk_error(), | ||||||
|     and png_chunk_warning() from pngpriv.h to png.h to make them visible |     and png_chunk_warning() from pngpriv.h to png.h to make them visible | ||||||
|     to libpng-calling applications. |     to libpng-calling applications. | ||||||
| @ -544,6 +544,10 @@ Version 1.7.0beta32 [February 16, 2014] | |||||||
|     compile and link on Android by using /proc/cpuinfo, and the old linux code |     compile and link on Android by using /proc/cpuinfo, and the old linux code | ||||||
|     is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux |     is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux | ||||||
|     dependencies apart from opening /proc/cpuinfo and is C90 compliant. |     dependencies apart from opening /proc/cpuinfo and is C90 compliant. | ||||||
|  |   Check for info_ptr == NULL early in png_read_end() so we don't need to | ||||||
|  |     run all the png_handle_*() and depend on them to return if info_ptr == NULL. | ||||||
|  |     This improves the performance of png_read_end(png_ptr, NULL) and makes | ||||||
|  |     it more robust against future programming errors. | ||||||
| 
 | 
 | ||||||
| Send comments/corrections/commendations to png-mng-implement at lists.sf.net | Send comments/corrections/commendations to png-mng-implement at lists.sf.net | ||||||
| (subscription required; visit | (subscription required; visit | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								CHANGES
									
									
									
									
									
								
							| @ -4822,7 +4822,7 @@ Version 1.7.0beta31 [February 6, 2014] | |||||||
|     and it adds corresponding code to pngimage.c to handle such options |     and it adds corresponding code to pngimage.c to handle such options | ||||||
|     by not attempting to test them. |     by not attempting to test them. | ||||||
| 
 | 
 | ||||||
| Version 1.7.0beta32 [February 16, 2014] | Version 1.7.0beta32 [February 17, 2014] | ||||||
|   Moved redefines of png_error(), png_warning(), png_chunk_error(), |   Moved redefines of png_error(), png_warning(), png_chunk_error(), | ||||||
|     and png_chunk_warning() from pngpriv.h to png.h to make them visible |     and png_chunk_warning() from pngpriv.h to png.h to make them visible | ||||||
|     to libpng-calling applications. |     to libpng-calling applications. | ||||||
| @ -4833,6 +4833,10 @@ Version 1.7.0beta32 [February 16, 2014] | |||||||
|     compile and link on Android by using /proc/cpuinfo, and the old linux code |     compile and link on Android by using /proc/cpuinfo, and the old linux code | ||||||
|     is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux |     is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux | ||||||
|     dependencies apart from opening /proc/cpuinfo and is C90 compliant. |     dependencies apart from opening /proc/cpuinfo and is C90 compliant. | ||||||
|  |   Check for info_ptr == NULL early in png_read_end() so we don't need to | ||||||
|  |     run all the png_handle_*() and depend on them to return if info_ptr == NULL. | ||||||
|  |     This improves the performance of png_read_end(png_ptr, NULL) and makes | ||||||
|  |     it more robust against future programming errors. | ||||||
| 
 | 
 | ||||||
| Send comments/corrections/commendations to png-mng-implement at lists.sf.net | Send comments/corrections/commendations to png-mng-implement at lists.sf.net | ||||||
| (subscription required; visit | (subscription required; visit | ||||||
|  | |||||||
| @ -781,11 +781,14 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) | |||||||
|       png_uint_32 length = png_read_chunk_header(png_ptr); |       png_uint_32 length = png_read_chunk_header(png_ptr); | ||||||
|       png_uint_32 chunk_name = png_ptr->chunk_name; |       png_uint_32 chunk_name = png_ptr->chunk_name; | ||||||
| 
 | 
 | ||||||
|       if (chunk_name == png_IHDR) |       if (chunk_name == png_IEND) | ||||||
|  |          png_handle_IEND(png_ptr, info_ptr, length); | ||||||
|  | 
 | ||||||
|  |       else if (chunk_name == png_IHDR) | ||||||
|          png_handle_IHDR(png_ptr, info_ptr, length); |          png_handle_IHDR(png_ptr, info_ptr, length); | ||||||
| 
 | 
 | ||||||
|       else if (chunk_name == png_IEND) |       else if (info_ptr == NULL) | ||||||
|          png_handle_IEND(png_ptr, info_ptr, length); |          png_crc_finish(png_ptr, length); | ||||||
| 
 | 
 | ||||||
| #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED | #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED | ||||||
|       else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) |       else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) | ||||||
|  | |||||||
| @ -1415,7 +1415,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) | |||||||
|                               (sizeof local_buffer), &length, |                               (sizeof local_buffer), &length, | ||||||
|                               profile + (sizeof profile_header), &size, 0); |                               profile + (sizeof profile_header), &size, 0); | ||||||
| 
 | 
 | ||||||
|                            /* Still expect a a buffer error because we expect
 |                            /* Still expect a buffer error because we expect
 | ||||||
|                             * there to be some tag data! |                             * there to be some tag data! | ||||||
|                             */ |                             */ | ||||||
|                            if (size == 0) |                            if (size == 0) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Glenn Randers-Pehrson
						Glenn Randers-Pehrson