From: Lutz M?l. <lu...@us...> - 2003-10-08 18:08:06
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1:/tmp/cvs-serv11064/libexif Modified Files: exif-data.c Log Message: 2003-10-08 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Patch by Jan Patera <pa...@pi...>. Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- exif-data.c 17 Sep 2003 11:31:06 -0000 1.27 +++ exif-data.c 8 Oct 2003 18:08:01 -0000 1.28 @@ -186,11 +186,16 @@ 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); |