fixed possible crash in exif_item_get_integer
authorVladimir Nadvornik <nadvornik@suse.cz>
Tue, 18 Aug 2009 20:19:23 +0000 (20:19 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 18 Aug 2009 20:19:23 +0000 (20:19 +0000)
src/exiv2.cc

index 624245d..ab310a5 100644 (file)
@@ -797,7 +797,7 @@ gchar *exif_item_get_string(ExifItem *item, int idx)
 gint exif_item_get_integer(ExifItem *item, gint *value)
 {
        try {
-               if (!item) return 0;
+               if (!item || exif_item_get_elements(item) == 0) return 0;
                *value = ((Exiv2::Metadatum *)item)->toLong();
                return 1;
        }