From 835ef14979c6953cbe9b4ead58649c587ccfe2ba Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Wed, 3 Aug 2016 17:05:31 +0200 Subject: [PATCH] Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi). Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE. The new behavior is to instead of stopping to parse, to continue so we can still fetch data like thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is enabled, a notice will display in case we do not match against a valid MAKERNOTE signature. This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further. --- ext/exif/exif.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index f62f77a60f..1dfa956ace 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1702,6 +1702,10 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c if (!length) break; case TAG_FMT_UNDEFINED: + if (tag == TAG_MAKER_NOTE) { + length = MIN(length, strlen(value)); + } + if (value) { if (tag == TAG_MAKER_NOTE) { length = MIN(length, strlen(value)); -- 2.50.1