On saving makernotes, make sure the makernote container tags has a type
authorMarcus Meissner <marcus@jet.franken.de>
Tue, 25 Jul 2017 21:38:56 +0000 (23:38 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 25 Jul 2017 21:38:56 +0000 (23:38 +0200)
with 1 byte components.

Fixes (at least):
https://sourceforge.net/p/libexif/bugs/130
https://sourceforge.net/p/libexif/bugs/129

libexif/exif-data.c

index 67df4db..91f4c33 100644 (file)
@@ -255,6 +255,12 @@ exif_data_save_data_entry (ExifData *data, ExifEntry *e,
                        exif_mnote_data_set_offset (data->priv->md, *ds - 6);
                        exif_mnote_data_save (data->priv->md, &e->data, &e->size);
                        e->components = e->size;
+                       if (exif_format_get_size (e->format) != 1) {
+                               /* e->format is taken from input code,
+                                * but we need to make sure it is a 1 byte
+                                * entity due to the multiplication below. */
+                               e->format = EXIF_FORMAT_UNDEFINED;
+                       }
                }
        }