summaryrefslogtreecommitdiff
path: root/src/cmsnamed.c
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2014-09-09 17:53:12 +0200
committerMarti Maria <info@littlecms.com>2014-09-09 17:53:12 +0200
commit5bc4f52ff6b2090863d824827a871cd6274e36e4 (patch)
tree0084154a8926dc703fd7d6be37fa703125c822d3 /src/cmsnamed.c
parent9c075b3e916e4478a98bebd92bcd219c51ef57f3 (diff)
downloadlcms2-5bc4f52ff6b2090863d824827a871cd6274e36e4.tar.gz
Fixed a macro clash on SNONE. Added a safety check on named color lists
Diffstat (limited to 'src/cmsnamed.c')
-rw-r--r--src/cmsnamed.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cmsnamed.c b/src/cmsnamed.c
index acfd1c8..29d0fa8 100644
--- a/src/cmsnamed.c
+++ b/src/cmsnamed.c
@@ -514,8 +514,9 @@ cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsContext ContextID, cmsUIn
v ->nColors = 0;
v ->ContextID = ContextID;
- while (v -> Allocated < n)
- GrowNamedColorList(v);
+ while (v -> Allocated < n){
+ if (!GrowNamedColorList(v)) return NULL;
+ }
strncpy(v ->Prefix, Prefix, sizeof(v ->Prefix)-1);
strncpy(v ->Suffix, Suffix, sizeof(v ->Suffix)-1);
@@ -544,8 +545,9 @@ cmsNAMEDCOLORLIST* CMSEXPORT cmsDupNamedColorList(const cmsNAMEDCOLORLIST* v)
if (NewNC == NULL) return NULL;
// For really large tables we need this
- while (NewNC ->Allocated < v ->Allocated)
- GrowNamedColorList(NewNC);
+ while (NewNC ->Allocated < v ->Allocated){
+ if (!GrowNamedColorList(NewNC)) return NULL;
+ }
memmove(NewNC ->Prefix, v ->Prefix, sizeof(v ->Prefix));
memmove(NewNC ->Suffix, v ->Suffix, sizeof(v ->Suffix));