From 7f1f960d4ffdb47ddb964b7d7753701b402f5214 Mon Sep 17 00:00:00 2001 From: Chris Blume Date: Wed, 31 Jan 2024 07:13:13 -0500 Subject: [PATCH] Add eXIf support to push mode libpng already supports eXIf as of v1.6.31. However, it seems like support was added for normal mode and not added to push mode. Notice PNG_READ_eXIfJSUPPORTED is in pngread.c: https://github.com/pnggroup/libpng/blob/libpng16/pngread.c#L178 but is missing from pngpread.c: https://github.com/pnggroup/libpng/blob/libpng16/pngpread.c#L274 This commit adds eXIf support to push mode. Signed-off-by: Cosmin Truta --- AUTHORS | 1 + pngpread.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/AUTHORS b/AUTHORS index bf962f6e1..544341694 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,6 +6,7 @@ Authors, for copyright and licensing purposes. * Adam Richter * Andreas Dilger + * Chris Blume * Cosmin Truta * Dave Martindale * Eric S. Raymond diff --git a/pngpread.c b/pngpread.c index be640f77a..ffab19c08 100644 --- a/pngpread.c +++ b/pngpread.c @@ -294,6 +294,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length); } +#endif +#ifdef PNG_READ_eXIf_SUPPORTED + else if (png_ptr->chunk_name == png_eXIf) + { + PNG_PUSH_SAVE_BUFFER_IF_FULL + png_handle_eXIf(png_ptr, info_ptr, png_ptr->push_length); + } + #endif #ifdef PNG_READ_sRGB_SUPPORTED else if (chunk_name == png_sRGB)