summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2013-05-28 18:17:48 +0100
committerRichard Hughes <richard@hughsie.com>2013-05-28 18:17:48 +0100
commit3261a3cc9063aaf807fd18b9322ce86598950406 (patch)
treee3b624737ebe3da07c3bf301711ec38bf5487282
parent3bd8a698e4340257957ff583dfc61890c33ff85e (diff)
downloadcolord-3261a3cc9063aaf807fd18b9322ce86598950406.tar.gz
Prevent a crash when compiling against old versions of LCMS
-rw-r--r--lib/colord/cd-icc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/colord/cd-icc.c b/lib/colord/cd-icc.c
index 35e1bc0..585844b 100644
--- a/lib/colord/cd-icc.c
+++ b/lib/colord/cd-icc.c
@@ -399,12 +399,18 @@ cd_icc_to_string (CdIcc *icc)
text_size = cmsMLUgetASCII (mlu,
cmsNoLanguage,
cmsNoCountry,
+ NULL, 0);
+ text_buffer = g_new0 (gchar, text_size + 1);
+ text_size = cmsMLUgetASCII (mlu,
+ cmsNoLanguage,
+ cmsNoCountry,
text_buffer,
- sizeof (text_buffer));
+ text_size);
if (text_size > 0) {
g_string_append_printf (str, " en_US:\t%s [%i bytes]\n",
text_buffer, text_size);
}
+ g_free (text_buffer);
#endif
break;
}