Skip to content

Commit 8c7ed2e

Browse files
committed
fix: Typo in a preprocessor directive
This is a regression of commit 2519a03 "refactor: Clean up the checking of chunk lengths and allocation limits" Compilation would break under the "right" non-default configuration. (Oopsie!) Also clean up comments in the surrounding code. Reported-by: chris0e3 <chris0e3@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
1 parent 2519a03 commit 8c7ed2e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

png.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,27 +268,22 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
268268
*/
269269
memset(&create_struct, 0, (sizeof create_struct));
270270

271-
/* Added at libpng-1.2.6 */
272271
# ifdef PNG_USER_LIMITS_SUPPORTED
273272
create_struct.user_width_max = PNG_USER_WIDTH_MAX;
274273
create_struct.user_height_max = PNG_USER_HEIGHT_MAX;
275274

276275
# ifdef PNG_USER_CHUNK_CACHE_MAX
277-
/* Added at libpng-1.2.43 and 1.4.0 */
278276
create_struct.user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
279277
# endif
280278

281-
/* Added at libpng-1.2.43 and 1.4.1, required only for read but exists
282-
* in png_struct regardless.
283-
*/
284279
# if PNG_USER_CHUNK_MALLOC_MAX > 0 /* default to compile-time limit */
285280
create_struct.user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX;
286281

287-
/* No compile time limit so initialize to the system limit: */
288-
# elif (defined PNG_MAX_MALLOC_64K/* legacy system limit */
282+
/* No compile-time limit, so initialize to the system limit: */
283+
# elif defined PNG_MAX_MALLOC_64K /* legacy system limit */
289284
create_struct.user_chunk_malloc_max = 65536U;
290285

291-
# else /* modern system limit SIZE_MAX (C99) */
286+
# else /* modern system limit SIZE_MAX (C99) */
292287
create_struct.user_chunk_malloc_max = PNG_SIZE_MAX;
293288
# endif
294289
# endif

0 commit comments

Comments
 (0)