From 8d34e7b419e5febcc2b9a566fb4916196c92b993 Mon Sep 17 00:00:00 2001 From: espie Date: Mon, 1 Jul 2013 17:44:20 +0000 Subject: [PATCH] yet another port with one single "declaration after code" problem... --- .../libexif/patches/patch-libexif_exif-entry_c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 graphics/libexif/patches/patch-libexif_exif-entry_c diff --git a/graphics/libexif/patches/patch-libexif_exif-entry_c b/graphics/libexif/patches/patch-libexif_exif-entry_c new file mode 100644 index 00000000000..abc2fc442b2 --- /dev/null +++ b/graphics/libexif/patches/patch-libexif_exif-entry_c @@ -0,0 +1,18 @@ +$OpenBSD: patch-libexif_exif-entry_c,v 1.1 2013/07/01 17:44:20 espie Exp $ +--- libexif/exif-entry.c.orig Mon Jul 1 19:38:16 2013 ++++ libexif/exif-entry.c Mon Jul 1 19:38:52 2013 +@@ -1375,12 +1375,13 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigne + case EXIF_TAG_XP_KEYWORDS: + case EXIF_TAG_XP_SUBJECT: + { ++ unsigned short *utf16; + /* Sanity check the size to prevent overflow */ + if (e->size+sizeof(unsigned short) < e->size) break; + + /* The tag may not be U+0000-terminated , so make a local + U+0000-terminated copy before converting it */ +- unsigned short *utf16 = exif_mem_alloc (e->priv->mem, e->size+sizeof(unsigned short)); ++ utf16 = exif_mem_alloc (e->priv->mem, e->size+sizeof(unsigned short)); + if (!utf16) break; + memcpy(utf16, e->data, e->size); + utf16[e->size/sizeof(unsigned short)] = 0;