Changeset 103316 in vbox for trunk/src/libs/libpng-1.6.42/pngerror.c
- Timestamp:
- Feb 12, 2024 3:57:56 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/libpng-1.6.42/pngerror.c
r96425 r103316 2 2 /* pngerror.c - stub functions for i/o and memory allocation 3 3 * 4 * Copyright (c) 2018 Cosmin Truta4 * Copyright (c) 2018-2024 Cosmin Truta 5 5 * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson 6 6 * Copyright (c) 1996-1997 Andreas Dilger … … 256 256 png_alloc_size_t value) 257 257 { 258 char buffer[PNG_NUMBER_BUFFER_SIZE] ;258 char buffer[PNG_NUMBER_BUFFER_SIZE] = {0}; 259 259 png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value)); 260 260 } … … 266 266 png_alloc_size_t u; 267 267 png_charp str; 268 char buffer[PNG_NUMBER_BUFFER_SIZE] ;268 char buffer[PNG_NUMBER_BUFFER_SIZE] = {0}; 269 269 270 270 /* Avoid overflow by doing the negate in a png_alloc_size_t: */ … … 859 859 return NULL; 860 860 861 return ( (png_voidp)png_ptr->error_ptr);861 return (png_voidp)png_ptr->error_ptr; 862 862 } 863 863 … … 934 934 935 935 int /* PRIVATE */ 936 png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg) 937 { 938 volatile png_imagep image = image_in; 939 volatile int result; 940 volatile png_voidp saved_error_buf; 936 png_safe_execute(png_imagep image, int (*function)(png_voidp), png_voidp arg) 937 { 938 png_voidp saved_error_buf = image->opaque->error_buf; 941 939 jmp_buf safe_jmpbuf; 942 943 /* Safely execute function(arg) with png_error returning to this function. */ 944 saved_error_buf = image->opaque->error_buf; 945 result = setjmp(safe_jmpbuf) == 0; 946 947 if (result != 0) 948 { 949 940 int result; 941 942 /* Safely execute function(arg), with png_error returning back here. */ 943 if (setjmp(safe_jmpbuf) == 0) 944 { 950 945 image->opaque->error_buf = safe_jmpbuf; 951 946 result = function(arg); 952 } 953 947 image->opaque->error_buf = saved_error_buf; 948 return result; 949 } 950 951 /* On png_error, return via longjmp, pop the jmpbuf, and free the image. */ 954 952 image->opaque->error_buf = saved_error_buf; 955 956 /* And do the cleanup prior to any failure return. */ 957 if (result == 0) 958 png_image_free(image); 959 960 return result; 953 png_image_free(image); 954 return 0; 961 955 } 962 956 #endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */
Note:
See TracChangeset
for help on using the changeset viewer.