blob: a7a0704623956d1c4d4e1719c4fc1d638c224e7f [file] [log] [blame] [edit]
--- lcms-1.19/src/cmsio1.c 2009-11-13 10:02:11.000000000 +0100
+++ lcms-1.19/src/cmsio1.c 2013-09-03 15:38:05.905867571 +0200
@@ -1637,13 +1637,13 @@ int ReadEmbeddedTextTag(LPLCMSICCPROFILE
if (Len < 0) Len = 0;
if (Len > 20*1024) Len = 20 * 1024;
- wchar = (wchar_t*) _cmsMalloc(Len*sizeof(wchar_t)+2);
+ wchar = (wchar_t*) _cmsMalloc(Len*sizeof(wchar_t)+sizeof(wchar_t));
if (!wchar) return -1;
if (Icc ->Read(wchar, 1, Len, Icc) != Len) return -1;
AdjustEndianessArray16((LPWORD) wchar, Len / 2);
- wchar[Len / 2] = L'\0';
+ wchar[Len / sizeof(wchar_t)] = L'\0';
i = wcstombs(Name, wchar, size_max );
if (i == ((size_t) -1)) {