diff options
| author | Anatol Belski <ab@php.net> | 2016-08-03 17:39:22 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2016-08-03 17:39:22 +0200 |
| commit | 0e82eb48cbf222563bef5d890978018982b06b73 (patch) | |
| tree | 0eff98aed71a24a0fec206137d1e5870ad0466c7 /ext/exif/exif.c | |
| parent | e3dabe448deadf81c7aed5598179d3663daef780 (diff) | |
| parent | f15c1553635ccb33c5f24d8ffe7a1cd05de5fe91 (diff) | |
| download | php-git-0e82eb48cbf222563bef5d890978018982b06b73.tar.gz | |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
update NEWS
Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Diffstat (limited to 'ext/exif/exif.c')
| -rw-r--r-- | ext/exif/exif.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index cf221419d5..a7452184f9 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) { /* do not recompute length here */ info_value->s = estrndup(value, length); @@ -2712,8 +2716,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu char *dir_start; for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) { - if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) - return FALSE; + if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) { +#ifdef EXIF_DEBUG + exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make)); +#endif + /* unknown manufacturer, not an error, use it as a string */ + return TRUE; + } + maker_note = maker_note_array+i; /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/ |
