OLD | NEW |
(Empty) | |
| 1 diff --git a/third_party/lcms2-2.6/src/cmsnamed.c b/third_party/lcms2-2.6/src/cm
snamed.c |
| 2 index acfd1c8..ef1eb30 100644 |
| 3 --- a/third_party/lcms2-2.6/src/cmsnamed.c |
| 4 +++ b/third_party/lcms2-2.6/src/cmsnamed.c |
| 5 @@ -514,8 +514,12 @@ cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsCont
ext ContextID, cmsUIn |
| 6 v ->nColors = 0; |
| 7 v ->ContextID = ContextID; |
| 8 |
| 9 - while (v -> Allocated < n) |
| 10 - GrowNamedColorList(v); |
| 11 + while (v -> Allocated < n) { |
| 12 + if (!GrowNamedColorList(v)) { |
| 13 + cmsFreeNamedColorList(v); |
| 14 + return NULL; |
| 15 + } |
| 16 + } |
| 17 |
| 18 strncpy(v ->Prefix, Prefix, sizeof(v ->Prefix)-1); |
| 19 strncpy(v ->Suffix, Suffix, sizeof(v ->Suffix)-1); |
| 20 @@ -544,8 +548,12 @@ cmsNAMEDCOLORLIST* CMSEXPORT cmsDupNamedColorList(const cms
NAMEDCOLORLIST* v) |
| 21 if (NewNC == NULL) return NULL; |
| 22 |
| 23 // For really large tables we need this |
| 24 - while (NewNC ->Allocated < v ->Allocated) |
| 25 - GrowNamedColorList(NewNC); |
| 26 + while (NewNC ->Allocated < v ->Allocated) { |
| 27 + if (!GrowNamedColorList(NewNC)) { |
| 28 + cmsFreeNamedColorList(NewNC); |
| 29 + return NULL; |
| 30 + } |
| 31 + } |
| 32 |
| 33 memmove(NewNC ->Prefix, v ->Prefix, sizeof(v ->Prefix)); |
| 34 memmove(NewNC ->Suffix, v ->Suffix, sizeof(v ->Suffix)); |
OLD | NEW |