From d66dea055522290c1ef34e3ae914146cd52b5d8e Mon Sep 17 00:00:00 2001
From: songnannan2 <songnannan2@huawei.com>
Date: Sat, 15 Feb 2020 20:44:53 +0800
Subject: [PATCH] libexif: modification summary

---
 libexif-0.6.21/libexif/exif-entry.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c
index 54a90a2..436e8a7 100644
--- a/libexif/exif-entry.c
+++ b/libexif/exif-entry.c
@@ -1085,7 +1085,7 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen)
 			break;
 		}
 		d = (double) v_rat.numerator / (double) v_rat.denominator;
-		if (d < 1)
+		if (d < 1 && d)
 			snprintf (val, maxlen, _("1/%i"), (int) (0.5 + 1. / d));
 		else
 			snprintf (val, maxlen, "%i", (int) d);
@@ -1102,8 +1102,9 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen)
 		}
 		d = (double) v_srat.numerator / (double) v_srat.denominator;
 		snprintf (val, maxlen, _("%.02f EV"), d);
-		d = 1. / pow (2, d);
-		if (d < 1)
+		if (pow (2, d))
+			d = 1. / pow (2, d);
+		if (d < 1 && d)
 		  snprintf (b, sizeof (b), _(" (1/%d sec.)"), (int) (1. / d));
 		else
 		  snprintf (b, sizeof (b), _(" (%d sec.)"), (int) d);
-- 
2.19.1

