2003-08-25 Lutz Mueller <lutz@users.sourceforge.net>
authorLutz Mueller <lutz.s.mueller@gmail.com>
Mon, 25 Aug 2003 04:44:30 +0000 (06:44 +0200)
committerLutz Mueller <lutz.s.mueller@gmail.com>
Mon, 25 Aug 2003 04:44:30 +0000 (06:44 +0200)
* libexif/exif-data.c: Fill unneeded bytes with 0. Suggestion by
  Roberto Costa <roberto.costa@ensta.org>.

ChangeLog
libexif/exif-data.c

index 21e90cf..301ebc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-25  Lutz Mueller <lutz@users.sourceforge.net>
+
+       * libexif/exif-data.c: Fill unneeded bytes with 0. Suggestion by
+         Roberto Costa <roberto.costa@ensta.org>.
+
 2003-08-06  Lutz Mueller <lutz@users.sourceforge.net>
 
        * libexif/exif-entry.c (exif_entry_initialize): Support some more
index 995dacf..679cc9b 100644 (file)
@@ -150,7 +150,10 @@ exif_data_save_data_entry (ExifData *data, ExifEntry *entry,
                               data->priv->order, doff);
        } else
                doff = offset + 8;
+
+       /* Write the data. Fill unneeded bytes with 0. */
        memcpy (*d + 6 + doff, entry->data, entry->size);
+       if (s < 4) memset (*d + 6 + doff + s, 0, (4 - s));
 }
 
 static void