From 17dfa05433478f50441281b425fba75470e5700d Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Thu, 25 Jul 2019 09:25:28 +0100 Subject: [PATCH] Bug fix: Compute TimeZone data Improved error detection --- src/exif-common.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/exif-common.c b/src/exif-common.c index fd2c6a3a..ce90d73c 100644 --- a/src/exif-common.c +++ b/src/exif-common.c @@ -703,6 +703,10 @@ static gboolean exif_build_tz_data(ExifData *exif, gchar **exif_date_time, gchar { lat_deg = strtok(text_latitude, "deg'"); lat_min = strtok(NULL, "deg'"); + if (!lat_deg || !lat_min) + { + return FALSE; + } latitude = atof(lat_deg) + atof(lat_min) / 60; if (!g_strcmp0(text_latitude_ref, "South")) { @@ -710,6 +714,10 @@ static gboolean exif_build_tz_data(ExifData *exif, gchar **exif_date_time, gchar } lon_deg = strtok(text_longitude, "deg'"); lon_min = strtok(NULL, "deg'"); + if (!lon_deg || !lon_min) + { + return FALSE; + } longitude = atof(lon_deg) + atof(lon_min) / 60; if (!g_strcmp0(text_longitude_ref, "West")) { -- 2.20.1