cf266799b2
The Image::Exif Perl extension allows the user to use the libexif library to extract EXIF information from JPEG files created by digital cameras. ok naddy@
34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
$OpenBSD: patch-sanyo_c,v 1.1.1.1 2004/05/17 05:09:53 robert Exp $
|
|
--- sanyo.c.orig 2004-05-03 11:50:01.000000000 -0700
|
|
+++ sanyo.c 2004-05-03 11:58:29.000000000 -0700
|
|
@@ -318,7 +318,7 @@ sanyo_prop(struct exifprop *prop, struct
|
|
(u_int16_t)((prop->value >> 8) & 0xff));
|
|
c2 = finddescr(sanyo_res, (u_int16_t)(prop->value & 0xff));
|
|
exifstralloc(&prop->str, strlen(c1) + strlen(c2) + 3);
|
|
- sprintf(prop->str, "%s, %s", c1, c2);
|
|
+ snprintf(prop->str, (strlen(c1) + strlen(c2) + 3), "%s, %s", c1, c2);
|
|
free(c1);
|
|
free(c2);
|
|
break;
|
|
@@ -330,9 +330,9 @@ sanyo_prop(struct exifprop *prop, struct
|
|
b = exif4byte(t->md.btiff + prop->value + 4, t->md.order);
|
|
|
|
if (!a || !b || a == b)
|
|
- snprintf(prop->str, 31, "None");
|
|
+ snprintf(prop->str, PROPSTR_SIZE, "None");
|
|
else
|
|
- snprintf(prop->str, 31, "x%.1f", (float)a / (float)b);
|
|
+ snprintf(prop->str, PROPSTR_SIZE, "x%.1f", (float)a / (float)b);
|
|
break;
|
|
|
|
/* Color adjust. */
|
|
@@ -357,7 +357,7 @@ sanyo_ifd(u_int32_t offset, struct tiffm
|
|
* try reading the IFD starting at offset + 8 ("SANYO" + 3).
|
|
*/
|
|
|
|
- if (!strcmp((const char *)(md->btiff + offset), "SANYO"))
|
|
+ if (!strncmp((const char *)(md->btiff + offset), "SANYO", 5))
|
|
readifd(offset + strlen("SANYO") + 3, &myifd, sanyo_tags, md);
|
|
else
|
|
readifd(offset, &myifd, sanyo_tags, md);
|