[eog-plugins] map: Perform simple validation on extracted coordinates
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog-plugins] map: Perform simple validation on extracted coordinates
- Date: Wed, 3 Sep 2014 17:55:57 +0000 (UTC)
commit 74bdd4aa13b8f64459ef4f3004ddf27acbb510e6
Author: Felix Riemann <friemann gnome org>
Date: Wed Sep 3 19:45:48 2014 +0200
map: Perform simple validation on extracted coordinates
Simply check whether the angles make sense. That should avoid hitting
an assertion in libchamplain with images having bogus values.
https://bugzilla.gnome.org/show_bug.cgi?id=735914
plugins/map/eog-map-plugin.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/map/eog-map-plugin.c b/plugins/map/eog-map-plugin.c
index d00ff97..0bfe9a4 100644
--- a/plugins/map/eog-map-plugin.c
+++ b/plugins/map/eog-map-plugin.c
@@ -134,7 +134,8 @@ get_coordinates (EogImage *image,
entry = exif_data_get_entry (exif_data,
EXIF_TAG_GPS_LONGITUDE);
- if (!parse_exif_gps_coordinate (entry, &lon, byte_order)) {
+ if (!parse_exif_gps_coordinate (entry, &lon, byte_order)
+ || (lon > 180.0)) {
exif_data_unref (exif_data);
return FALSE;
}
@@ -150,7 +151,8 @@ get_coordinates (EogImage *image,
entry = exif_data_get_entry (exif_data,
EXIF_TAG_GPS_LATITUDE);
- if (!parse_exif_gps_coordinate (entry, &lat, byte_order)) {
+ if (!parse_exif_gps_coordinate (entry, &lat, byte_order)
+ || (lat > 90.0)) {
exif_data_unref (exif_data);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]