diff src/exif.c @ 57:a8c9992320f4

Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net> * exif.c (exif_parse_IFD_table): Fix offset count before testing against buffer size. * exif.h: Make exif_text_list_find_value available. * format_canon.c: Fix copy's length when duping Canon.SerialNumber, and adjust several text descriptions. * format_fuji.c: Remove "MkN." text from tag names. * format_nikon.c: Fix offset count before testing against buffer size, and remove "MkN." text from tag names. Add several new tags. * format_olympus.[ch]: New files for olympus makernote. * format_raw.c: Add exif olympus hook. * src/Makefile.am: Add format_olympus.[ch].
author gqview
date Sat, 11 Jun 2005 01:09:30 +0000
parents 1e21f094e0be
children df73b94154e4
line wrap: on
line diff
--- a/src/exif.c	Fri Jun 10 06:23:22 2005 +0000
+++ b/src/exif.c	Sat Jun 11 01:09:30 2005 +0000
@@ -562,7 +562,7 @@
 	return string;
 }
 
-static gchar *text_list_find_value(ExifTextList *list, guint value)
+gchar *exif_text_list_find_value(ExifTextList *list, guint value)
 {
 	gchar *result = NULL;
 	gint i;
@@ -865,10 +865,10 @@
 	if (size < offset + 2) return -1;
 
 	count = exif_byte_get_int16(tiff + offset, bo);
+	offset += 2;
 
 	/* Entries and next IFD offset must be readable */
 	if (size < offset + count * EXIF_TIFD_SIZE + 4) return -1;
-	offset += 2;
 
 	for (i = 0; i < count; i++)
 		{
@@ -1181,7 +1181,7 @@
 					val = (unsigned char)(((signed char *)data)[0]);
 					}
 
-				result = text_list_find_value(marker->list, (guint)val);
+				result = exif_text_list_find_value(marker->list, (guint)val);
 				string = g_string_append(string, result);
 				g_free(result);
 				}
@@ -1198,7 +1198,7 @@
 				{
 				gchar *result;
 
-				result = text_list_find_value(marker->list, ((unsigned short *)data)[0]);
+				result = exif_text_list_find_value(marker->list, ((unsigned short *)data)[0]);
 				string = g_string_append(string, result);
 				g_free(result);
 				}
@@ -1493,7 +1493,7 @@
 		if (!exif_get_integer(exif, "Flash", &n)) return NULL;
 
 		/* Exif 2.1 only defines first 3 bits */
-		if (n <= 0x07) return g_strdup(text_list_find_value(ExifFlashList, n));
+		if (n <= 0x07) return g_strdup(exif_text_list_find_value(ExifFlashList, n));
 
 		/* must be Exif 2.2 */
 		string = g_string_new("");