2003-10-08 Lutz Mueller <lutz@users.sourceforge.net>
authorLutz Mueller <lutz.s.mueller@gmail.com>
Wed, 8 Oct 2003 18:08:01 +0000 (20:08 +0200)
committerLutz Mueller <lutz.s.mueller@gmail.com>
Wed, 8 Oct 2003 18:08:01 +0000 (20:08 +0200)
* libexif/exif-data.c: Patch by Jan Patera <patera@pictview.com>.

ChangeLog
libexif/exif-data.c

index 9a43952..d0c3b3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2003-10-08  Lutz Mueller <lutz@users.sourceforge.net>
 
+       * libexif/exif-data.c: Patch by Jan Patera <patera@pictview.com>.
+
+2003-10-08  Lutz Mueller <lutz@users.sourceforge.net>
+
        * libexif/exif-entry.c: Patch by Jan Patera <patera@pictview.com>.
 
 2003-09-28  Lutz Mueller <lutz@users.sourceforge.net>
index 9df2e2d..6dfea7e 100644 (file)
@@ -186,11 +186,16 @@ exif_data_load_data_content (ExifData *data, ExifContent *ifd,
        ExifTag tag;
 
        /* Read the number of entries */
+       if (offset >= ds - 1) return;
        n = exif_get_short (d + offset, data->priv->order);
 #ifdef DEBUG
        printf ("Loading %i entries...\n", n);
 #endif
        offset += 2;
+
+       /* Check if we have enough data. */
+       if (offset + 12 * n > ds) n = (ds - offset) / 12;
+
        for (i = 0; i < n; i++) {
 
                tag = exif_get_short (d + offset + 12 * i, data->priv->order);