changeset 1692:bb964a9d9bb8

fixed possible crash in exif_item_get_integer
author nadvornik
date Tue, 18 Aug 2009 20:19:23 +0000
parents db9a5d850c03
children 573f57b945b2
files src/exiv2.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/exiv2.cc	Mon Aug 03 20:47:14 2009 +0000
+++ b/src/exiv2.cc	Tue Aug 18 20:19:23 2009 +0000
@@ -797,7 +797,7 @@
 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;
 	}