Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 260269 | Differences between
and this patch

Collapse All | Expand All

(-)lcms-1.18-orig/include/lcms.h (-1 / +4 lines)
Lines 1423-1429 Link Here
1423
LCMS_INLINE void* _cmsCalloc(size_t nmemb, size_t size)
1423
LCMS_INLINE void* _cmsCalloc(size_t nmemb, size_t size)
1424
{
1424
{
1425
    size_t alloc = nmemb * size;
1425
    size_t alloc = nmemb * size;
1426
    if (alloc < nmemb || alloc < size) {
1426
    if (size == 0) {
1427
      return _cmsMalloc(0);
1428
    }
1429
    if (alloc / size != nmemb) {
1427
        return NULL;
1430
        return NULL;
1428
    }
1431
    }
1429
    return _cmsMalloc(alloc);
1432
    return _cmsMalloc(alloc);
(-)lcms-1.18-orig/src/cmsio0.c (-1 / +5 lines)
Lines 77-83 Link Here
77
     size_t len = size * count;
77
     size_t len = size * count;
78
     size_t extent = ResData -> Pointer + len;
78
     size_t extent = ResData -> Pointer + len;
79
79
80
      if (len < size || len < count) {
80
      if (len == 0) {
81
          return 0;
82
      }
83
84
      if (len / size != count) {
81
          cmsSignalError(LCMS_ERRC_ABORTED, "Read from memory error. Integer overflow with count / size.");
85
          cmsSignalError(LCMS_ERRC_ABORTED, "Read from memory error. Integer overflow with count / size.");
82
          return 0;
86
          return 0;
83
      }
87
      }
(-)lcms-1.18-orig/src/cmslut.c (-2 / +2 lines)
Lines 200-213 Link Here
200
      oldCalc = calc;
200
      oldCalc = calc;
201
      calc *= NewLUT -> cLutPoints;
201
      calc *= NewLUT -> cLutPoints;
202
202
203
      if (calc < oldCalc || calc < NewLUT -> cLutPoints) {
203
      if (calc / NewLUT -> cLutPoints != oldCalc) {
204
        return FALSE;
204
        return FALSE;
205
      }
205
      }
206
    }
206
    }
207
207
208
    oldCalc = calc;
208
    oldCalc = calc;
209
    calc *= NewLUT -> OutputChan;
209
    calc *= NewLUT -> OutputChan;
210
    if (calc < oldCalc || calc < NewLUT -> OutputChan) {
210
    if (NewLUT -> OutputChan && calc / NewLUT -> OutputChan != oldCalc) {
211
      return FALSE;
211
      return FALSE;
212
    }
212
    }
213
213

Return to bug 260269