[tracker] Fix crash when EXIF focal length value is empty
- From: Ivan Frade <ifrade src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Fix crash when EXIF focal length value is empty
- Date: Mon, 30 Nov 2009 13:03:14 +0000 (UTC)
commit b3ef621a4d70e25893c69d30bbe2a47d1bfed573
Author: Rene Stadler <mail renestadler de>
Date: Mon Nov 30 14:58:59 2009 +0200
Fix crash when EXIF focal length value is empty
src/tracker-extract/tracker-exif.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-exif.c b/src/tracker-extract/tracker-exif.c
index e67aefa..6d84d62 100644
--- a/src/tracker-extract/tracker-exif.c
+++ b/src/tracker-extract/tracker-exif.c
@@ -92,8 +92,14 @@ get_focal_length(ExifData *exif, ExifTag tag)
if (entry) {
gchar buf[1024];
+ const gchar *end;
exif_entry_get_value (entry, buf, 1024);
- return g_strndup (buf, strstr (buf, " mm") - buf);
+ end = g_strstr_len (buf, 1024, " mm");
+ if (end) {
+ return g_strndup (buf, end - buf);
+ } else {
+ return NULL;
+ }
}
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]