project
stringclasses
633 values
commit_id
stringlengths
7
81
target
int64
0
1
func
stringlengths
5
484k
cwe
stringclasses
131 values
big_vul_idx
float64
0
189k
idx
int64
0
522k
hash
stringlengths
34
39
size
float64
1
24k
message
stringlengths
0
11.5k
dataset
stringclasses
1 value
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceGrayColorSpace::getGrayLine(Guchar *in, Guchar *out, int length) { memcpy (out, in, length); }
CWE-189
1,057
11,648
6452156121397726806114466124590477839
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceRGBColorSpace::getGrayLine(Guchar *in, Guchar *out, int length) { int i; for (i = 0; i < length; i++) { out[i] = (in[i * 3 + 0] * 19595 + in[i * 3 + 1] * 38469 + in[i * 3 + 2] * 7472) / 65536; } }
CWE-189
1,058
11,649
270529877161175063134422926256364325921
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
int GfxColorSpace::getNumColorSpaceModes() { return nGfxColorSpaceModes; }
CWE-189
1,059
11,650
153770046529545245458436413048571872609
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { rgb->r = rgb->g = rgb->b = clip01(color->c[0]); }
CWE-189
1,060
11,651
207321791761116403112181487682653951181
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxCalGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double X, Y, Z; double r, g, b; getXYZ(color,&X,&Y,&Z); #ifdef USE_CMS if (XYZ2DisplayTransform != NULL && displayPixelType == PT_RGB) { Guchar out[gfxColorMaxComps]; double in[gfxColorMaxComps]; in[0] = clip01(X); in[1] = clip01(Y); in[2] = clip01(Z); XYZ2DisplayTransform->doTransform(in,out,1); rgb->r = byteToCol(out[0]); rgb->g = byteToCol(out[1]); rgb->b = byteToCol(out[2]); return; } #endif X *= whiteX; Y *= whiteY; Z *= whiteZ; r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z; g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z; b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z; rgb->r = dblToCol(pow(clip01(r * kr), 0.5)); rgb->g = dblToCol(pow(clip01(g * kg), 0.5)); rgb->b = dblToCol(pow(clip01(b * kb), 0.5)); rgb->r = rgb->g = rgb->b = clip01(color->c[0]); }
CWE-189
1,061
11,652
329264052058247341513730305027856801996
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { rgb->r = clip01(color->c[0]); rgb->g = clip01(color->c[1]); rgb->b = clip01(color->c[2]); }
CWE-189
1,062
11,653
110300622811377203913550050327336422483
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxCalRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double X, Y, Z; double r, g, b; getXYZ(color,&X,&Y,&Z); #ifdef USE_CMS if (XYZ2DisplayTransform != NULL && displayPixelType == PT_RGB) { Guchar out[gfxColorMaxComps]; double in[gfxColorMaxComps]; in[0] = clip01(X/whiteX); in[1] = clip01(Y/whiteY); in[2] = clip01(Z/whiteZ); XYZ2DisplayTransform->doTransform(in,out,1); rgb->r = byteToCol(out[0]); rgb->g = byteToCol(out[1]); rgb->b = byteToCol(out[2]); return; } #endif r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z; g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z; b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z; rgb->r = dblToCol(pow(clip01(r), 0.5)); rgb->g = dblToCol(pow(clip01(g), 0.5)); rgb->b = dblToCol(pow(clip01(b), 0.5)); }
CWE-189
1,063
11,654
243667760756204017017438379398817808478
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double c, m, y, k, c1, m1, y1, k1, r, g, b, x; c = colToDbl(color->c[0]); m = colToDbl(color->c[1]); y = colToDbl(color->c[2]); k = colToDbl(color->c[3]); c1 = 1 - c; m1 = 1 - m; y1 = 1 - y; k1 = 1 - k; x = c1 * m1 * y1 * k1; // 0 0 0 0 r = g = b = x; x = c1 * m1 * y1 * k; // 0 0 0 1 r += 0.1373 * x; g += 0.1216 * x; b += 0.1255 * x; x = c1 * m1 * y * k1; // 0 0 1 0 r += x; g += 0.9490 * x; x = c1 * m1 * y * k; // 0 0 1 1 r += 0.1098 * x; g += 0.1020 * x; x = c1 * m * y1 * k1; // 0 1 0 0 r += 0.9255 * x; b += 0.5490 * x; x = c1 * m * y1 * k; // 0 1 0 1 r += 0.1412 * x; x = c1 * m * y * k1; // 0 1 1 0 r += 0.9294 * x; g += 0.1098 * x; b += 0.1412 * x; x = c1 * m * y * k; // 0 1 1 1 r += 0.1333 * x; x = c * m1 * y1 * k1; // 1 0 0 0 g += 0.6784 * x; b += 0.9373 * x; x = c * m1 * y1 * k; // 1 0 0 1 g += 0.0588 * x; b += 0.1412 * x; x = c * m1 * y * k1; // 1 0 1 0 g += 0.6510 * x; b += 0.3137 * x; x = c * m1 * y * k; // 1 0 1 1 g += 0.0745 * x; x = c * m * y1 * k1; // 1 1 0 0 r += 0.1804 * x; g += 0.1922 * x; b += 0.5725 * x; x = c * m * y1 * k; // 1 1 0 1 b += 0.0078 * x; x = c * m * y * k1; // 1 1 1 0 r += 0.2118 * x; g += 0.2119 * x; b += 0.2235 * x; rgb->r = clip01(dblToCol(r)); rgb->g = clip01(dblToCol(g)); rgb->b = clip01(dblToCol(b)); }
CWE-189
1,064
11,655
311600520066285773114944675693179819012
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxLabColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double X, Y, Z; double r, g, b; getXYZ(color, &X, &Y, &Z); #ifdef USE_CMS if (XYZ2DisplayTransform != NULL && displayPixelType == PT_RGB) { Guchar out[gfxColorMaxComps]; double in[gfxColorMaxComps]; in[0] = clip01(X); in[1] = clip01(Y); in[2] = clip01(Z); XYZ2DisplayTransform->doTransform(in,out,1); rgb->r = byteToCol(out[0]); rgb->g = byteToCol(out[1]); rgb->b = byteToCol(out[2]); return; } #endif X *= whiteX; Y *= whiteY; Z *= whiteZ; r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z; g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z; b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z; rgb->r = dblToCol(pow(clip01(r * kr), 0.5)); rgb->g = dblToCol(pow(clip01(g * kg), 0.5)); rgb->b = dblToCol(pow(clip01(b * kb), 0.5)); }
CWE-189
1,065
11,656
295425501075167173582514158735258978262
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxICCBasedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { #ifdef USE_CMS if (transform != 0 && (displayProfile == NULL || displayPixelType == PT_RGB)) { Guchar in[gfxColorMaxComps]; Guchar out[gfxColorMaxComps]; for (int i = 0;i < nComps;i++) { in[i] = colToByte(color->c[i]); } transform->doTransform(in,out,1); rgb->r = byteToCol(out[0]); rgb->g = byteToCol(out[1]); rgb->b = byteToCol(out[2]); } else { alt->getRGB(color, rgb); } #else alt->getRGB(color, rgb); #endif }
CWE-189
1,066
11,657
210972303565506678681265039979190888985
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxIndexedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { GfxColor color2; base->getRGB(mapColorToBase(color, &color2), rgb); }
CWE-189
1,067
11,658
99751010240208494389269793627788464922
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxSeparationColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double x; double c[gfxColorMaxComps]; GfxColor color2; int i; x = colToDbl(color->c[0]); func->transform(&x, c); for (i = 0; i < alt->getNComps(); ++i) { color2.c[i] = dblToCol(c[i]); } alt->getRGB(&color2, rgb); }
CWE-189
1,068
11,659
246925655721218391116723566244465055032
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceNColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { double x[gfxColorMaxComps], c[gfxColorMaxComps]; GfxColor color2; int i; for (i = 0; i < nComps; ++i) { x[i] = colToDbl(color->c[i]); } func->transform(x, c); for (i = 0; i < alt->getNComps(); ++i) { color2.c[i] = dblToCol(c[i]); } alt->getRGB(&color2, rgb); }
CWE-189
1,069
11,660
82830784359937651309002015007918240805
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxPatternColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { rgb->r = rgb->g = rgb->b = 0; }
CWE-189
1,070
11,661
219281763810714401791300585200630406323
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxImageColorMap::getRGB(Guchar *x, GfxRGB *rgb) { GfxColor color; int i; if (colorSpace2) { for (i = 0; i < nComps2; ++i) { color.c[i] = lookup[i][x[0]]; } colorSpace2->getRGB(&color, rgb); } else { for (i = 0; i < nComps; ++i) { color.c[i] = lookup[i][x[i]]; } colorSpace->getRGB(&color, rgb); } }
CWE-189
1,071
11,662
196714606831729759134366853932001935178
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) { int i, j, n; GfxColor color; GfxRGB rgb; n = getNComps(); for (i = 0; i < length; i++) { for (j = 0; j < n; j++) color.c[j] = in[i * n + j] * 256; getRGB (&color, &rgb); out[i] = ((int) colToByte(rgb.r) << 16) | ((int) colToByte(rgb.g) << 8) | ((int) colToByte(rgb.b) << 0); } }
CWE-189
1,072
11,663
219260753519107401609854047420170178760
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceGrayColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) { int i; for (i = 0; i < length; i++) out[i] = (in[i] << 16) | (in[i] << 8) | (in[i] << 0); }
CWE-189
1,073
11,664
263785925510236847141139768453050125567
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxDeviceRGBColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) { Guchar *p; int i; for (i = 0, p = in; i < length; i++, p += 3) out[i] = (p[0] << 16) | (p[1] << 8) | (p[2] << 0); }
CWE-189
1,074
11,665
187994887355588372863746355089843850700
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxICCBasedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) { #ifdef USE_CMS if (lineTransform != 0) { for (int i = 0;i < length;i++) { Guchar tmp[gfxColorMaxComps]; lineTransform->doTransform(in,tmp,1); in += nComps; out[i] = (tmp[0] << 16) | (tmp[1] << 8) | tmp[2]; } } else { alt->getRGBLine(in, out, length); } #else alt->getRGBLine(in, out, length); #endif }
CWE-189
1,075
11,666
48976066093228590316144529442815114886
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
double GfxState::getTransformedFontSize() { double x1, y1, x2, y2; x1 = textMat[2] * fontSize; y1 = textMat[3] * fontSize; x2 = ctm[0] * x1 + ctm[2] * y1; y2 = ctm[1] * x1 + ctm[3] * y1; return sqrt(x2 * x2 + y2 * y2); }
CWE-189
1,076
11,667
264290327752038135368492828955767722528
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxGouraudTriangleShading::getTriangle( int i, double *x0, double *y0, GfxColor *color0, double *x1, double *y1, GfxColor *color1, double *x2, double *y2, GfxColor *color2) { double in; double out[gfxColorMaxComps]; int v, j; v = triangles[i][0]; *x0 = vertices[v].x; *y0 = vertices[v].y; if (nFuncs > 0) { in = colToDbl(vertices[v].color.c[0]); for (j = 0; j < nFuncs; ++j) { funcs[j]->transform(&in, &out[j]); } for (j = 0; j < gfxColorMaxComps; ++j) { color0->c[j] = dblToCol(out[j]); } } else { *color0 = vertices[v].color; } v = triangles[i][1]; *x1 = vertices[v].x; *y1 = vertices[v].y; if (nFuncs > 0) { in = colToDbl(vertices[v].color.c[0]); for (j = 0; j < nFuncs; ++j) { funcs[j]->transform(&in, &out[j]); } for (j = 0; j < gfxColorMaxComps; ++j) { color1->c[j] = dblToCol(out[j]); } } else { *color1 = vertices[v].color; } v = triangles[i][2]; *x2 = vertices[v].x; *y2 = vertices[v].y; if (nFuncs > 0) { in = colToDbl(vertices[v].color.c[0]); for (j = 0; j < nFuncs; ++j) { funcs[j]->transform(&in, &out[j]); } for (j = 0; j < gfxColorMaxComps; ++j) { color2->c[j] = dblToCol(out[j]); } } else { *color2 = vertices[v].color; } }
CWE-189
1,077
11,668
17021225266985097503107964448831628220
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::getUserClipBBox(double *xMin, double *yMin, double *xMax, double *yMax) { double ictm[6]; double xMin1, yMin1, xMax1, yMax1, det, tx, ty; det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]); ictm[0] = ctm[3] * det; ictm[1] = -ctm[1] * det; ictm[2] = -ctm[2] * det; ictm[3] = ctm[0] * det; ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det; ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det; xMin1 = xMax1 = clipXMin * ictm[0] + clipYMin * ictm[2] + ictm[4]; yMin1 = yMax1 = clipXMin * ictm[1] + clipYMin * ictm[3] + ictm[5]; tx = clipXMin * ictm[0] + clipYMax * ictm[2] + ictm[4]; ty = clipXMin * ictm[1] + clipYMax * ictm[3] + ictm[5]; if (tx < xMin1) { xMin1 = tx; } else if (tx > xMax1) { xMax1 = tx; } if (ty < yMin1) { yMin1 = ty; } else if (ty > yMax1) { yMax1 = ty; } tx = clipXMax * ictm[0] + clipYMin * ictm[2] + ictm[4]; ty = clipXMax * ictm[1] + clipYMin * ictm[3] + ictm[5]; if (tx < xMin1) { xMin1 = tx; } else if (tx > xMax1) { xMax1 = tx; } if (ty < yMin1) { yMin1 = ty; } else if (ty > yMax1) { yMax1 = ty; } tx = clipXMax * ictm[0] + clipYMax * ictm[2] + ictm[4]; ty = clipXMax * ictm[1] + clipYMax * ictm[3] + ictm[5]; if (tx < xMin1) { xMin1 = tx; } else if (tx > xMax1) { xMax1 = tx; } if (ty < yMin1) { yMin1 = ty; } else if (ty > yMax1) { yMax1 = ty; } *xMin = xMin1; *yMin = yMin1; *xMax = xMax1; *yMax = yMax1; }
CWE-189
1,078
11,669
189632895203752869207739891527631376621
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxCalRGBColorSpace::getXYZ(GfxColor *color, double *pX, double *pY, double *pZ) { double A, B, C; A = colToDbl(color->c[0]); B = colToDbl(color->c[1]); C = colToDbl(color->c[2]); *pX = mat[0]*pow(A,gammaR)+mat[3]*pow(B,gammaG)+mat[6]*pow(C,gammaB); *pY = mat[1]*pow(A,gammaR)+mat[4]*pow(B,gammaG)+mat[7]*pow(C,gammaB); *pZ = mat[2]*pow(A,gammaR)+mat[5]*pow(B,gammaG)+mat[8]*pow(C,gammaB); }
CWE-189
1,079
11,670
240398339111627644572733680064104260265
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxLabColorSpace::getXYZ(GfxColor *color, double *pX, double *pY, double *pZ) { double X, Y, Z; double t1, t2; t1 = (colToDbl(color->c[0]) + 16) / 116; t2 = t1 + colToDbl(color->c[1]) / 500; if (t2 >= (6.0 / 29.0)) { X = t2 * t2 * t2; } else { X = (108.0 / 841.0) * (t2 - (4.0 / 29.0)); } if (t1 >= (6.0 / 29.0)) { Y = t1 * t1 * t1; } else { Y = (108.0 / 841.0) * (t1 - (4.0 / 29.0)); } t2 = t1 - colToDbl(color->c[2]) / 200; if (t2 >= (6.0 / 29.0)) { Z = t2 * t2 * t2; } else { Z = (108.0 / 841.0) * (t2 - (4.0 / 29.0)); } *pX = X; *pY = Y; *pZ = Z; }
CWE-189
1,080
11,671
21551559698872741654436725591981947290
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GBool GfxShading::init(Dict *dict) { Object obj1, obj2; int i; dict->lookup("ColorSpace", &obj1); if (!(colorSpace = GfxColorSpace::parse(&obj1))) { error(-1, "Bad color space in shading dictionary"); obj1.free(); return gFalse; } obj1.free(); for (i = 0; i < gfxColorMaxComps; ++i) { background.c[i] = 0; } hasBackground = gFalse; if (dict->lookup("Background", &obj1)->isArray()) { if (obj1.arrayGetLength() == colorSpace->getNComps()) { hasBackground = gTrue; for (i = 0; i < colorSpace->getNComps(); ++i) { background.c[i] = dblToCol(obj1.arrayGet(i, &obj2)->getNum()); obj2.free(); } } else { error(-1, "Bad Background in shading dictionary"); } } obj1.free(); xMin = yMin = xMax = yMax = 0; hasBBox = gFalse; if (dict->lookup("BBox", &obj1)->isArray()) { if (obj1.arrayGetLength() == 4) { hasBBox = gTrue; xMin = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); yMin = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); xMax = obj1.arrayGet(2, &obj2)->getNum(); obj2.free(); yMax = obj1.arrayGet(3, &obj2)->getNum(); obj2.free(); } else { error(-1, "Bad BBox in shading dictionary"); } } obj1.free(); return gTrue; }
CWE-189
1,081
11,672
257440076952078060972482132108323357659
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GBool Matrix::invertTo(Matrix *other) { double det; det = 1 / (m[0] * m[3] - m[1] * m[2]); other->m[0] = m[3] * det; other->m[1] = -m[1] * det; other->m[2] = -m[2] * det; other->m[3] = m[0] * det; other->m[4] = (m[2] * m[5] - m[3] * m[4]) * det; other->m[5] = (m[1] * m[4] - m[0] * m[5]) * det; return gTrue; }
CWE-189
1,082
11,673
204489655696726289594209346368814596403
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxSubpath::lineTo(double x1, double y1) { if (n >= size) { size += 16; x = (double *)greallocn(x, size, sizeof(double)); y = (double *)greallocn(y, size, sizeof(double)); curve = (GBool *)greallocn(curve, size, sizeof(GBool)); } x[n] = x1; y[n] = y1; curve[n] = gFalse; ++n; }
CWE-189
1,083
11,674
13253450693671283690312538943592231743
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxICCBasedColorSpace *GfxICCBasedCache::lookup(int numA, int genA) { int i; if (cache[0].num == numA && cache[0].gen == genA) { return (GfxICCBasedColorSpace *)cache[0].colorSpace->copy(); } for (i = 1;i < GFX_ICCBASED_CACHE_SIZE && cache[i].num > 0;i++) { if (cache[i].num == numA && cache[i].gen == genA) { int j; GfxICCBasedCache hit = cache[i]; for (j = i;j > 0;j--) { if (cache[j - 1].num > 0) cache[j] = cache[j-1]; } cache[0] = hit; return (GfxICCBasedColorSpace *)hit.colorSpace->copy(); } } return NULL; }
CWE-189
1,085
11,675
91437594257086783255705155726573816731
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColor *GfxIndexedColorSpace::mapColorToBase(GfxColor *color, GfxColor *baseColor) { Guchar *p; double low[gfxColorMaxComps], range[gfxColorMaxComps]; int n, i; n = base->getNComps(); base->getDefaultRanges(low, range, indexHigh); p = &lookup[(int)(colToDbl(color->c[0]) + 0.5) * n]; for (i = 0; i < n; ++i) { baseColor->c[i] = dblToCol(low[i] + (p[i] / 255.0) * range[i]); } return baseColor; }
CWE-189
1,086
11,676
72540493913167931088578033833152026340
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxPath::moveTo(double x, double y) { justMoved = gTrue; firstX = x; firstY = y; }
CWE-189
1,087
11,677
97473596944160369890128649167837967805
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxSubpath::offset(double dx, double dy) { int i; for (i = 0; i < n; ++i) { x[i] += dx; y[i] += dy; } }
CWE-189
1,088
11,678
247602153285395220596839130926044040020
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxPath::offset(double dx, double dy) { int i; for (i = 0; i < n; ++i) { subpaths[i]->offset(dx, dy); } }
CWE-189
1,089
11,679
185457709991254760175234809325188901458
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxColorSpace::parse(Object *csObj) { GfxColorSpace *cs; Object obj1; cs = NULL; if (csObj->isName()) { if (csObj->isName("DeviceGray") || csObj->isName("G")) { cs = new GfxDeviceGrayColorSpace(); } else if (csObj->isName("DeviceRGB") || csObj->isName("RGB")) { cs = new GfxDeviceRGBColorSpace(); } else if (csObj->isName("DeviceCMYK") || csObj->isName("CMYK")) { cs = new GfxDeviceCMYKColorSpace(); } else if (csObj->isName("Pattern")) { cs = new GfxPatternColorSpace(NULL); } else { error(-1, "Bad color space '%s'", csObj->getName()); } } else if (csObj->isArray()) { csObj->arrayGet(0, &obj1); if (obj1.isName("DeviceGray") || obj1.isName("G")) { cs = new GfxDeviceGrayColorSpace(); } else if (obj1.isName("DeviceRGB") || obj1.isName("RGB")) { cs = new GfxDeviceRGBColorSpace(); } else if (obj1.isName("DeviceCMYK") || obj1.isName("CMYK")) { cs = new GfxDeviceCMYKColorSpace(); } else if (obj1.isName("CalGray")) { cs = GfxCalGrayColorSpace::parse(csObj->getArray()); } else if (obj1.isName("CalRGB")) { cs = GfxCalRGBColorSpace::parse(csObj->getArray()); } else if (obj1.isName("Lab")) { cs = GfxLabColorSpace::parse(csObj->getArray()); } else if (obj1.isName("ICCBased")) { cs = GfxICCBasedColorSpace::parse(csObj->getArray()); } else if (obj1.isName("Indexed") || obj1.isName("I")) { cs = GfxIndexedColorSpace::parse(csObj->getArray()); } else if (obj1.isName("Separation")) { cs = GfxSeparationColorSpace::parse(csObj->getArray()); } else if (obj1.isName("DeviceN")) { cs = GfxDeviceNColorSpace::parse(csObj->getArray()); } else if (obj1.isName("Pattern")) { cs = GfxPatternColorSpace::parse(csObj->getArray()); } else { error(-1, "Bad color space"); } obj1.free(); } else { error(-1, "Bad color space - expected name or array"); } return cs; }
CWE-189
1,090
11,680
163631747771221177530945577511673988468
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxCalGrayColorSpace::parse(Array *arr) { GfxCalGrayColorSpace *cs; Object obj1, obj2, obj3; arr->get(1, &obj1); if (!obj1.isDict()) { error(-1, "Bad CalGray color space"); obj1.free(); return NULL; } cs = new GfxCalGrayColorSpace(); if (obj1.dictLookup("WhitePoint", &obj2)->isArray() && obj2.arrayGetLength() == 3) { obj2.arrayGet(0, &obj3); cs->whiteX = obj3.getNum(); obj3.free(); obj2.arrayGet(1, &obj3); cs->whiteY = obj3.getNum(); obj3.free(); obj2.arrayGet(2, &obj3); cs->whiteZ = obj3.getNum(); obj3.free(); } obj2.free(); if (obj1.dictLookup("BlackPoint", &obj2)->isArray() && obj2.arrayGetLength() == 3) { obj2.arrayGet(0, &obj3); cs->blackX = obj3.getNum(); obj3.free(); obj2.arrayGet(1, &obj3); cs->blackY = obj3.getNum(); obj3.free(); obj2.arrayGet(2, &obj3); cs->blackZ = obj3.getNum(); obj3.free(); } obj2.free(); if (obj1.dictLookup("Gamma", &obj2)->isNum()) { cs->gamma = obj2.getNum(); } obj2.free(); obj1.free(); cs->kr = 1 / (xyzrgb[0][0] * cs->whiteX + xyzrgb[0][1] * cs->whiteY + xyzrgb[0][2] * cs->whiteZ); cs->kg = 1 / (xyzrgb[1][0] * cs->whiteX + xyzrgb[1][1] * cs->whiteY + xyzrgb[1][2] * cs->whiteZ); cs->kb = 1 / (xyzrgb[2][0] * cs->whiteX + xyzrgb[2][1] * cs->whiteY + xyzrgb[2][2] * cs->whiteZ); return cs; }
CWE-189
1,091
11,681
243972677497503506061891402321301992522
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxCalRGBColorSpace::parse(Array *arr) { GfxCalRGBColorSpace *cs; Object obj1, obj2, obj3; int i; arr->get(1, &obj1); if (!obj1.isDict()) { error(-1, "Bad CalRGB color space"); obj1.free(); return NULL; } cs = new GfxCalRGBColorSpace(); if (obj1.dictLookup("WhitePoint", &obj2)->isArray() && obj2.arrayGetLength() == 3) { obj2.arrayGet(0, &obj3); cs->whiteX = obj3.getNum(); obj3.free(); obj2.arrayGet(1, &obj3); cs->whiteY = obj3.getNum(); obj3.free(); obj2.arrayGet(2, &obj3); cs->whiteZ = obj3.getNum(); obj3.free(); } obj2.free(); if (obj1.dictLookup("BlackPoint", &obj2)->isArray() && obj2.arrayGetLength() == 3) { obj2.arrayGet(0, &obj3); cs->blackX = obj3.getNum(); obj3.free(); obj2.arrayGet(1, &obj3); cs->blackY = obj3.getNum(); obj3.free(); obj2.arrayGet(2, &obj3); cs->blackZ = obj3.getNum(); obj3.free(); } obj2.free(); if (obj1.dictLookup("Gamma", &obj2)->isArray() && obj2.arrayGetLength() == 3) { obj2.arrayGet(0, &obj3); cs->gammaR = obj3.getNum(); obj3.free(); obj2.arrayGet(1, &obj3); cs->gammaG = obj3.getNum(); obj3.free(); obj2.arrayGet(2, &obj3); cs->gammaB = obj3.getNum(); obj3.free(); } obj2.free(); if (obj1.dictLookup("Matrix", &obj2)->isArray() && obj2.arrayGetLength() == 9) { for (i = 0; i < 9; ++i) { obj2.arrayGet(i, &obj3); cs->mat[i] = obj3.getNum(); obj3.free(); } } obj2.free(); obj1.free(); cs->kr = 1 / (xyzrgb[0][0] * cs->whiteX + xyzrgb[0][1] * cs->whiteY + xyzrgb[0][2] * cs->whiteZ); cs->kg = 1 / (xyzrgb[1][0] * cs->whiteX + xyzrgb[1][1] * cs->whiteY + xyzrgb[1][2] * cs->whiteZ); cs->kb = 1 / (xyzrgb[2][0] * cs->whiteX + xyzrgb[2][1] * cs->whiteY + xyzrgb[2][2] * cs->whiteZ); return cs; }
CWE-189
1,092
11,682
44640416556252819529461352960588958164
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr) { GfxICCBasedColorSpace *cs; Ref iccProfileStreamA; int nCompsA; GfxColorSpace *altA; Dict *dict; Object obj1, obj2, obj3; int i; arr->getNF(1, &obj1); if (obj1.isRef()) { iccProfileStreamA = obj1.getRef(); } else { iccProfileStreamA.num = 0; iccProfileStreamA.gen = 0; } obj1.free(); #ifdef USE_CMS if (iccProfileStreamA.num > 0 && (cs = GfxICCBasedCache::lookup(iccProfileStreamA.num, iccProfileStreamA.gen)) != NULL) return cs; #endif arr->get(1, &obj1); if (!obj1.isStream()) { error(-1, "Bad ICCBased color space (stream)"); obj1.free(); return NULL; } dict = obj1.streamGetDict(); if (!dict->lookup("N", &obj2)->isInt()) { error(-1, "Bad ICCBased color space (N)"); obj2.free(); obj1.free(); return NULL; } nCompsA = obj2.getInt(); obj2.free(); if (nCompsA > gfxColorMaxComps) { error(-1, "ICCBased color space with too many (%d > %d) components", nCompsA, gfxColorMaxComps); nCompsA = gfxColorMaxComps; } if (dict->lookup("Alternate", &obj2)->isNull() || !(altA = GfxColorSpace::parse(&obj2))) { switch (nCompsA) { case 1: altA = new GfxDeviceGrayColorSpace(); break; case 3: altA = new GfxDeviceRGBColorSpace(); break; case 4: altA = new GfxDeviceCMYKColorSpace(); break; default: error(-1, "Bad ICCBased color space - invalid N"); obj2.free(); obj1.free(); return NULL; } } obj2.free(); cs = new GfxICCBasedColorSpace(nCompsA, altA, &iccProfileStreamA); if (dict->lookup("Range", &obj2)->isArray() && obj2.arrayGetLength() == 2 * nCompsA) { for (i = 0; i < nCompsA; ++i) { obj2.arrayGet(2*i, &obj3); cs->rangeMin[i] = obj3.getNum(); obj3.free(); obj2.arrayGet(2*i+1, &obj3); cs->rangeMax[i] = obj3.getNum(); obj3.free(); } } obj2.free(); obj1.free(); #ifdef USE_CMS arr->get(1, &obj1); dict = obj1.streamGetDict(); Guchar *profBuf; unsigned int bufSize; Stream *iccStream = obj1.getStream(); int c; unsigned int size = 0; bufSize = 65536; profBuf = (Guchar *)gmallocn(bufSize,1); iccStream->reset(); while ((c = iccStream->getChar()) != EOF) { if (bufSize <= size) { bufSize += 65536; profBuf = (Guchar *)greallocn(profBuf,bufSize,1); } profBuf[size++] = c; } cmsHPROFILE hp = cmsOpenProfileFromMem(profBuf,size); gfree(profBuf); if (hp == 0) { error(-1, "read ICCBased color space profile error"); } else { cmsHPROFILE dhp = displayProfile; if (dhp == NULL) dhp = RGBProfile; unsigned int cst = getCMSColorSpaceType(cmsGetColorSpace(hp)); unsigned int dNChannels = getCMSNChannels(cmsGetColorSpace(dhp)); unsigned int dcst = getCMSColorSpaceType(cmsGetColorSpace(dhp)); cmsHTRANSFORM transform; if ((transform = cmsCreateTransform(hp, COLORSPACE_SH(cst) |CHANNELS_SH(nCompsA) | BYTES_SH(1), dhp, COLORSPACE_SH(dcst) | CHANNELS_SH(dNChannels) | BYTES_SH(1), INTENT_RELATIVE_COLORIMETRIC,0)) == 0) { error(-1, "Can't create transform"); } cs->transform = new GfxColorTransform(transform); if (dcst == PT_RGB) { if ((transform = cmsCreateTransform(hp, CHANNELS_SH(nCompsA) | BYTES_SH(1),dhp, TYPE_RGB_8,INTENT_RELATIVE_COLORIMETRIC,0)) == 0) { error(-1, "Can't create transform"); } cs->lineTransform = new GfxColorTransform(transform); } cmsCloseProfile(hp); } obj1.free(); if (iccProfileStreamA.num > 0) { GfxICCBasedCache::put(iccProfileStreamA.num,iccProfileStreamA.gen,cs); } #endif return cs; }
CWE-189
1,094
11,683
136188857121085961220559070468438827146
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxIndexedColorSpace::parse(Array *arr) { GfxIndexedColorSpace *cs; GfxColorSpace *baseA; int indexHighA; Object obj1; int x; char *s; int n, i, j; if (arr->getLength() != 4) { error(-1, "Bad Indexed color space"); goto err1; } arr->get(1, &obj1); if (!(baseA = GfxColorSpace::parse(&obj1))) { error(-1, "Bad Indexed color space (base color space)"); goto err2; } obj1.free(); if (!arr->get(2, &obj1)->isInt()) { error(-1, "Bad Indexed color space (hival)"); delete baseA; goto err2; } indexHighA = obj1.getInt(); if (indexHighA < 0 || indexHighA > 255) { int previousValue = indexHighA; if (indexHighA < 0) indexHighA = 0; else indexHighA = 255; error(-1, "Bad Indexed color space (invalid indexHigh value, was %d using %d to try to recover)", previousValue, indexHighA); } obj1.free(); cs = new GfxIndexedColorSpace(baseA, indexHighA); arr->get(3, &obj1); n = baseA->getNComps(); if (obj1.isStream()) { obj1.streamReset(); for (i = 0; i <= indexHighA; ++i) { for (j = 0; j < n; ++j) { if ((x = obj1.streamGetChar()) == EOF) { error(-1, "Bad Indexed color space (lookup table stream too short) padding with zeroes"); x = 0; } cs->lookup[i*n + j] = (Guchar)x; } } obj1.streamClose(); } else if (obj1.isString()) { if (obj1.getString()->getLength() < (indexHighA + 1) * n) { error(-1, "Bad Indexed color space (lookup table string too short)"); goto err3; } s = obj1.getString()->getCString(); for (i = 0; i <= indexHighA; ++i) { for (j = 0; j < n; ++j) { cs->lookup[i*n + j] = (Guchar)*s++; } } } else { error(-1, "Bad Indexed color space (lookup table)"); goto err3; } obj1.free(); return cs; err3: delete cs; err2: obj1.free(); err1: return NULL; }
CWE-189
1,095
11,684
299059357191606655262664704051725189271
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxSeparationColorSpace::parse(Array *arr) { GfxSeparationColorSpace *cs; GooString *nameA; GfxColorSpace *altA; Function *funcA; Object obj1; if (arr->getLength() != 4) { error(-1, "Bad Separation color space"); goto err1; } if (!arr->get(1, &obj1)->isName()) { error(-1, "Bad Separation color space (name)"); goto err2; } nameA = new GooString(obj1.getName()); obj1.free(); arr->get(2, &obj1); if (!(altA = GfxColorSpace::parse(&obj1))) { error(-1, "Bad Separation color space (alternate color space)"); goto err3; } obj1.free(); arr->get(3, &obj1); if (!(funcA = Function::parse(&obj1))) { goto err4; } obj1.free(); cs = new GfxSeparationColorSpace(nameA, altA, funcA); return cs; err4: delete altA; err3: delete nameA; err2: obj1.free(); err1: return NULL; }
CWE-189
1,096
11,685
223878711615538106346876784720035605656
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxDeviceNColorSpace::parse(Array *arr) { GfxDeviceNColorSpace *cs; int nCompsA; GooString *namesA[gfxColorMaxComps]; GfxColorSpace *altA; Function *funcA; Object obj1, obj2; int i; if (arr->getLength() != 4 && arr->getLength() != 5) { error(-1, "Bad DeviceN color space"); goto err1; } if (!arr->get(1, &obj1)->isArray()) { error(-1, "Bad DeviceN color space (names)"); goto err2; } nCompsA = obj1.arrayGetLength(); if (nCompsA > gfxColorMaxComps) { error(-1, "DeviceN color space with too many (%d > %d) components", nCompsA, gfxColorMaxComps); nCompsA = gfxColorMaxComps; } for (i = 0; i < nCompsA; ++i) { if (!obj1.arrayGet(i, &obj2)->isName()) { error(-1, "Bad DeviceN color space (names)"); obj2.free(); goto err2; } namesA[i] = new GooString(obj2.getName()); obj2.free(); } obj1.free(); arr->get(2, &obj1); if (!(altA = GfxColorSpace::parse(&obj1))) { error(-1, "Bad DeviceN color space (alternate color space)"); goto err3; } obj1.free(); arr->get(3, &obj1); if (!(funcA = Function::parse(&obj1))) { goto err4; } obj1.free(); cs = new GfxDeviceNColorSpace(nCompsA, altA, funcA); cs->nonMarking = gTrue; for (i = 0; i < nCompsA; ++i) { cs->names[i] = namesA[i]; if (namesA[i]->cmp("None")) { cs->nonMarking = gFalse; } } return cs; err4: delete altA; err3: for (i = 0; i < nCompsA; ++i) { delete namesA[i]; } err2: obj1.free(); err1: return NULL; }
CWE-189
1,097
11,686
81129591959847046904396936707400140489
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace *GfxPatternColorSpace::parse(Array *arr) { GfxPatternColorSpace *cs; GfxColorSpace *underA; Object obj1; if (arr->getLength() != 1 && arr->getLength() != 2) { error(-1, "Bad Pattern color space"); return NULL; } underA = NULL; if (arr->getLength() == 2) { arr->get(1, &obj1); if (!(underA = GfxColorSpace::parse(&obj1))) { error(-1, "Bad Pattern color space (underlying color space)"); obj1.free(); return NULL; } obj1.free(); } cs = new GfxPatternColorSpace(underA); return cs; }
CWE-189
1,098
11,687
16026989043562902236741679169688002352
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxPattern *GfxPattern::parse(Object *obj) { GfxPattern *pattern; Object obj1; if (obj->isDict()) { obj->dictLookup("PatternType", &obj1); } else if (obj->isStream()) { obj->streamGetDict()->lookup("PatternType", &obj1); } else { return NULL; } pattern = NULL; if (obj1.isInt() && obj1.getInt() == 1) { pattern = GfxTilingPattern::parse(obj); } else if (obj1.isInt() && obj1.getInt() == 2) { pattern = GfxShadingPattern::parse(obj); } obj1.free(); return pattern; }
CWE-189
1,099
11,688
208940908908501394364102727473138278164
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxTilingPattern *GfxTilingPattern::parse(Object *patObj) { GfxTilingPattern *pat; Dict *dict; int paintTypeA, tilingTypeA; double bboxA[4], matrixA[6]; double xStepA, yStepA; Object resDictA; Object obj1, obj2; int i; if (!patObj->isStream()) { return NULL; } dict = patObj->streamGetDict(); if (dict->lookup("PaintType", &obj1)->isInt()) { paintTypeA = obj1.getInt(); } else { paintTypeA = 1; error(-1, "Invalid or missing PaintType in pattern"); } obj1.free(); if (dict->lookup("TilingType", &obj1)->isInt()) { tilingTypeA = obj1.getInt(); } else { tilingTypeA = 1; error(-1, "Invalid or missing TilingType in pattern"); } obj1.free(); bboxA[0] = bboxA[1] = 0; bboxA[2] = bboxA[3] = 1; if (dict->lookup("BBox", &obj1)->isArray() && obj1.arrayGetLength() == 4) { for (i = 0; i < 4; ++i) { if (obj1.arrayGet(i, &obj2)->isNum()) { bboxA[i] = obj2.getNum(); } obj2.free(); } } else { error(-1, "Invalid or missing BBox in pattern"); } obj1.free(); if (dict->lookup("XStep", &obj1)->isNum()) { xStepA = obj1.getNum(); } else { xStepA = 1; error(-1, "Invalid or missing XStep in pattern"); } obj1.free(); if (dict->lookup("YStep", &obj1)->isNum()) { yStepA = obj1.getNum(); } else { yStepA = 1; error(-1, "Invalid or missing YStep in pattern"); } obj1.free(); if (!dict->lookup("Resources", &resDictA)->isDict()) { resDictA.free(); resDictA.initNull(); error(-1, "Invalid or missing Resources in pattern"); } matrixA[0] = 1; matrixA[1] = 0; matrixA[2] = 0; matrixA[3] = 1; matrixA[4] = 0; matrixA[5] = 0; if (dict->lookup("Matrix", &obj1)->isArray() && obj1.arrayGetLength() == 6) { for (i = 0; i < 6; ++i) { if (obj1.arrayGet(i, &obj2)->isNum()) { matrixA[i] = obj2.getNum(); } obj2.free(); } } obj1.free(); pat = new GfxTilingPattern(paintTypeA, tilingTypeA, bboxA, xStepA, yStepA, &resDictA, matrixA, patObj); resDictA.free(); return pat; }
CWE-189
1,100
11,689
12784805908137826782200719162156559254
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxShadingPattern *GfxShadingPattern::parse(Object *patObj) { Dict *dict; GfxShading *shadingA; double matrixA[6]; Object obj1, obj2; int i; if (!patObj->isDict()) { return NULL; } dict = patObj->getDict(); dict->lookup("Shading", &obj1); shadingA = GfxShading::parse(&obj1); obj1.free(); if (!shadingA) { return NULL; } matrixA[0] = 1; matrixA[1] = 0; matrixA[2] = 0; matrixA[3] = 1; matrixA[4] = 0; matrixA[5] = 0; if (dict->lookup("Matrix", &obj1)->isArray() && obj1.arrayGetLength() == 6) { for (i = 0; i < 6; ++i) { if (obj1.arrayGet(i, &obj2)->isNum()) { matrixA[i] = obj2.getNum(); } obj2.free(); } } obj1.free(); return new GfxShadingPattern(shadingA, matrixA); }
CWE-189
1,101
11,690
189538767313718541087934980340890661529
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxShading *GfxShading::parse(Object *obj) { GfxShading *shading; Dict *dict; int typeA; Object obj1; if (obj->isDict()) { dict = obj->getDict(); } else if (obj->isStream()) { dict = obj->streamGetDict(); } else { return NULL; } if (!dict->lookup("ShadingType", &obj1)->isInt()) { error(-1, "Invalid ShadingType in shading dictionary"); obj1.free(); return NULL; } typeA = obj1.getInt(); obj1.free(); switch (typeA) { case 1: shading = GfxFunctionShading::parse(dict); break; case 2: shading = GfxAxialShading::parse(dict); break; case 3: shading = GfxRadialShading::parse(dict); break; case 4: if (obj->isStream()) { shading = GfxGouraudTriangleShading::parse(4, dict, obj->getStream()); } else { error(-1, "Invalid Type 4 shading object"); goto err1; } break; case 5: if (obj->isStream()) { shading = GfxGouraudTriangleShading::parse(5, dict, obj->getStream()); } else { error(-1, "Invalid Type 5 shading object"); goto err1; } break; case 6: if (obj->isStream()) { shading = GfxPatchMeshShading::parse(6, dict, obj->getStream()); } else { error(-1, "Invalid Type 6 shading object"); goto err1; } break; case 7: if (obj->isStream()) { shading = GfxPatchMeshShading::parse(7, dict, obj->getStream()); } else { error(-1, "Invalid Type 7 shading object"); goto err1; } break; default: error(-1, "Unimplemented shading type %d", typeA); goto err1; } return shading; err1: return NULL; }
CWE-189
1,102
11,691
281793566038432708750111342735072599016
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxFunctionShading *GfxFunctionShading::parse(Dict *dict) { GfxFunctionShading *shading; double x0A, y0A, x1A, y1A; double matrixA[6]; Function *funcsA[gfxColorMaxComps]; int nFuncsA; Object obj1, obj2; int i; x0A = y0A = 0; x1A = y1A = 1; if (dict->lookup("Domain", &obj1)->isArray() && obj1.arrayGetLength() == 4) { x0A = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); x1A = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); y0A = obj1.arrayGet(2, &obj2)->getNum(); obj2.free(); y1A = obj1.arrayGet(3, &obj2)->getNum(); obj2.free(); } obj1.free(); matrixA[0] = 1; matrixA[1] = 0; matrixA[2] = 0; matrixA[3] = 1; matrixA[4] = 0; matrixA[5] = 0; if (dict->lookup("Matrix", &obj1)->isArray() && obj1.arrayGetLength() == 6) { matrixA[0] = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); matrixA[1] = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); matrixA[2] = obj1.arrayGet(2, &obj2)->getNum(); obj2.free(); matrixA[3] = obj1.arrayGet(3, &obj2)->getNum(); obj2.free(); matrixA[4] = obj1.arrayGet(4, &obj2)->getNum(); obj2.free(); matrixA[5] = obj1.arrayGet(5, &obj2)->getNum(); obj2.free(); } obj1.free(); dict->lookup("Function", &obj1); if (obj1.isArray()) { nFuncsA = obj1.arrayGetLength(); if (nFuncsA > gfxColorMaxComps) { error(-1, "Invalid Function array in shading dictionary"); goto err1; } for (i = 0; i < nFuncsA; ++i) { obj1.arrayGet(i, &obj2); if (!(funcsA[i] = Function::parse(&obj2))) { goto err2; } obj2.free(); } } else { nFuncsA = 1; if (!(funcsA[0] = Function::parse(&obj1))) { goto err1; } } obj1.free(); shading = new GfxFunctionShading(x0A, y0A, x1A, y1A, matrixA, funcsA, nFuncsA); if (!shading->init(dict)) { delete shading; return NULL; } return shading; err2: obj2.free(); err1: obj1.free(); return NULL; }
CWE-189
1,103
11,692
232678004786480873538313727488522723358
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxAxialShading *GfxAxialShading::parse(Dict *dict) { GfxAxialShading *shading; double x0A, y0A, x1A, y1A; double t0A, t1A; Function *funcsA[gfxColorMaxComps]; int nFuncsA; GBool extend0A, extend1A; Object obj1, obj2; int i; x0A = y0A = x1A = y1A = 0; if (dict->lookup("Coords", &obj1)->isArray() && obj1.arrayGetLength() == 4) { x0A = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); y0A = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); x1A = obj1.arrayGet(2, &obj2)->getNum(); obj2.free(); y1A = obj1.arrayGet(3, &obj2)->getNum(); obj2.free(); } else { error(-1, "Missing or invalid Coords in shading dictionary"); goto err1; } obj1.free(); t0A = 0; t1A = 1; if (dict->lookup("Domain", &obj1)->isArray() && obj1.arrayGetLength() == 2) { t0A = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); t1A = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); } obj1.free(); dict->lookup("Function", &obj1); if (obj1.isArray()) { nFuncsA = obj1.arrayGetLength(); if (nFuncsA > gfxColorMaxComps) { error(-1, "Invalid Function array in shading dictionary"); goto err1; } for (i = 0; i < nFuncsA; ++i) { obj1.arrayGet(i, &obj2); if (!(funcsA[i] = Function::parse(&obj2))) { obj1.free(); obj2.free(); goto err1; } obj2.free(); } } else { nFuncsA = 1; if (!(funcsA[0] = Function::parse(&obj1))) { obj1.free(); goto err1; } } obj1.free(); extend0A = extend1A = gFalse; if (dict->lookup("Extend", &obj1)->isArray() && obj1.arrayGetLength() == 2) { extend0A = obj1.arrayGet(0, &obj2)->getBool(); obj2.free(); extend1A = obj1.arrayGet(1, &obj2)->getBool(); obj2.free(); } obj1.free(); shading = new GfxAxialShading(x0A, y0A, x1A, y1A, t0A, t1A, funcsA, nFuncsA, extend0A, extend1A); if (!shading->init(dict)) { delete shading; return NULL; } return shading; err1: return NULL; }
CWE-189
1,104
11,693
213862131739948098925006434836975754545
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxRadialShading *GfxRadialShading::parse(Dict *dict) { GfxRadialShading *shading; double x0A, y0A, r0A, x1A, y1A, r1A; double t0A, t1A; Function *funcsA[gfxColorMaxComps]; int nFuncsA; GBool extend0A, extend1A; Object obj1, obj2; int i; x0A = y0A = r0A = x1A = y1A = r1A = 0; if (dict->lookup("Coords", &obj1)->isArray() && obj1.arrayGetLength() == 6) { x0A = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); y0A = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); r0A = obj1.arrayGet(2, &obj2)->getNum(); obj2.free(); x1A = obj1.arrayGet(3, &obj2)->getNum(); obj2.free(); y1A = obj1.arrayGet(4, &obj2)->getNum(); obj2.free(); r1A = obj1.arrayGet(5, &obj2)->getNum(); obj2.free(); } else { error(-1, "Missing or invalid Coords in shading dictionary"); goto err1; } obj1.free(); t0A = 0; t1A = 1; if (dict->lookup("Domain", &obj1)->isArray() && obj1.arrayGetLength() == 2) { t0A = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); t1A = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); } obj1.free(); dict->lookup("Function", &obj1); if (obj1.isArray()) { nFuncsA = obj1.arrayGetLength(); if (nFuncsA > gfxColorMaxComps) { error(-1, "Invalid Function array in shading dictionary"); goto err1; } for (i = 0; i < nFuncsA; ++i) { obj1.arrayGet(i, &obj2); if (!(funcsA[i] = Function::parse(&obj2))) { obj1.free(); obj2.free(); goto err1; } obj2.free(); } } else { nFuncsA = 1; if (!(funcsA[0] = Function::parse(&obj1))) { obj1.free(); goto err1; } } obj1.free(); extend0A = extend1A = gFalse; if (dict->lookup("Extend", &obj1)->isArray() && obj1.arrayGetLength() == 2) { extend0A = obj1.arrayGet(0, &obj2)->getBool(); obj2.free(); extend1A = obj1.arrayGet(1, &obj2)->getBool(); obj2.free(); } obj1.free(); shading = new GfxRadialShading(x0A, y0A, r0A, x1A, y1A, r1A, t0A, t1A, funcsA, nFuncsA, extend0A, extend1A); if (!shading->init(dict)) { delete shading; return NULL; } return shading; err1: return NULL; }
CWE-189
1,105
11,694
326880181746693915663485459593389435853
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxPatchMeshShading *GfxPatchMeshShading::parse(int typeA, Dict *dict, Stream *str) { GfxPatchMeshShading *shading; Function *funcsA[gfxColorMaxComps]; int nFuncsA; int coordBits, compBits, flagBits; double xMin, xMax, yMin, yMax; double cMin[gfxColorMaxComps], cMax[gfxColorMaxComps]; double xMul, yMul; double cMul[gfxColorMaxComps]; GfxPatch *patchesA, *p; int nComps, nPatchesA, patchesSize, nPts, nColors; Guint flag; double x[16], y[16]; Guint xi, yi; GfxColorComp c[4][gfxColorMaxComps]; Guint ci[4]; GfxShadingBitBuf *bitBuf; Object obj1, obj2; int i, j; if (dict->lookup("BitsPerCoordinate", &obj1)->isInt()) { coordBits = obj1.getInt(); } else { error(-1, "Missing or invalid BitsPerCoordinate in shading dictionary"); goto err2; } obj1.free(); if (dict->lookup("BitsPerComponent", &obj1)->isInt()) { compBits = obj1.getInt(); } else { error(-1, "Missing or invalid BitsPerComponent in shading dictionary"); goto err2; } obj1.free(); if (dict->lookup("BitsPerFlag", &obj1)->isInt()) { flagBits = obj1.getInt(); } else { error(-1, "Missing or invalid BitsPerFlag in shading dictionary"); goto err2; } obj1.free(); if (dict->lookup("Decode", &obj1)->isArray() && obj1.arrayGetLength() >= 6) { xMin = obj1.arrayGet(0, &obj2)->getNum(); obj2.free(); xMax = obj1.arrayGet(1, &obj2)->getNum(); obj2.free(); xMul = (xMax - xMin) / (pow(2.0, coordBits) - 1); yMin = obj1.arrayGet(2, &obj2)->getNum(); obj2.free(); yMax = obj1.arrayGet(3, &obj2)->getNum(); obj2.free(); yMul = (yMax - yMin) / (pow(2.0, coordBits) - 1); for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) { cMin[i] = obj1.arrayGet(4 + 2*i, &obj2)->getNum(); obj2.free(); cMax[i] = obj1.arrayGet(5 + 2*i, &obj2)->getNum(); obj2.free(); cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1); } nComps = i; } else { error(-1, "Missing or invalid Decode array in shading dictionary"); goto err2; } obj1.free(); if (!dict->lookup("Function", &obj1)->isNull()) { if (obj1.isArray()) { nFuncsA = obj1.arrayGetLength(); if (nFuncsA > gfxColorMaxComps) { error(-1, "Invalid Function array in shading dictionary"); goto err1; } for (i = 0; i < nFuncsA; ++i) { obj1.arrayGet(i, &obj2); if (!(funcsA[i] = Function::parse(&obj2))) { obj1.free(); obj2.free(); goto err1; } obj2.free(); } } else { nFuncsA = 1; if (!(funcsA[0] = Function::parse(&obj1))) { obj1.free(); goto err1; } } } else { nFuncsA = 0; } obj1.free(); nPatchesA = 0; patchesA = NULL; patchesSize = 0; bitBuf = new GfxShadingBitBuf(str); while (1) { if (!bitBuf->getBits(flagBits, &flag)) { break; } if (typeA == 6) { switch (flag) { case 0: nPts = 12; nColors = 4; break; case 1: case 2: case 3: default: nPts = 8; nColors = 2; break; } } else { switch (flag) { case 0: nPts = 16; nColors = 4; break; case 1: case 2: case 3: default: nPts = 12; nColors = 2; break; } } for (i = 0; i < nPts; ++i) { if (!bitBuf->getBits(coordBits, &xi) || !bitBuf->getBits(coordBits, &yi)) { break; } x[i] = xMin + xMul * (double)xi; y[i] = yMin + yMul * (double)yi; } if (i < nPts) { break; } for (i = 0; i < nColors; ++i) { for (j = 0; j < nComps; ++j) { if (!bitBuf->getBits(compBits, &ci[j])) { break; } c[i][j] = dblToCol(cMin[j] + cMul[j] * (double)ci[j]); } if (j < nComps) { break; } } if (i < nColors) { break; } if (nPatchesA == patchesSize) { patchesSize = (patchesSize == 0) ? 16 : 2 * patchesSize; patchesA = (GfxPatch *)greallocn(patchesA, patchesSize, sizeof(GfxPatch)); } p = &patchesA[nPatchesA]; if (typeA == 6) { switch (flag) { case 0: p->x[0][0] = x[0]; p->y[0][0] = y[0]; p->x[0][1] = x[1]; p->y[0][1] = y[1]; p->x[0][2] = x[2]; p->y[0][2] = y[2]; p->x[0][3] = x[3]; p->y[0][3] = y[3]; p->x[1][3] = x[4]; p->y[1][3] = y[4]; p->x[2][3] = x[5]; p->y[2][3] = y[5]; p->x[3][3] = x[6]; p->y[3][3] = y[6]; p->x[3][2] = x[7]; p->y[3][2] = y[7]; p->x[3][1] = x[8]; p->y[3][1] = y[8]; p->x[3][0] = x[9]; p->y[3][0] = y[9]; p->x[2][0] = x[10]; p->y[2][0] = y[10]; p->x[1][0] = x[11]; p->y[1][0] = y[11]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = c[0][j]; p->color[0][1].c[j] = c[1][j]; p->color[1][1].c[j] = c[2][j]; p->color[1][0].c[j] = c[3][j]; } break; case 1: p->x[0][0] = patchesA[nPatchesA-1].x[0][3]; p->y[0][0] = patchesA[nPatchesA-1].y[0][3]; p->x[0][1] = patchesA[nPatchesA-1].x[1][3]; p->y[0][1] = patchesA[nPatchesA-1].y[1][3]; p->x[0][2] = patchesA[nPatchesA-1].x[2][3]; p->y[0][2] = patchesA[nPatchesA-1].y[2][3]; p->x[0][3] = patchesA[nPatchesA-1].x[3][3]; p->y[0][3] = patchesA[nPatchesA-1].y[3][3]; p->x[1][3] = x[0]; p->y[1][3] = y[0]; p->x[2][3] = x[1]; p->y[2][3] = y[1]; p->x[3][3] = x[2]; p->y[3][3] = y[2]; p->x[3][2] = x[3]; p->y[3][2] = y[3]; p->x[3][1] = x[4]; p->y[3][1] = y[4]; p->x[3][0] = x[5]; p->y[3][0] = y[5]; p->x[2][0] = x[6]; p->y[2][0] = y[6]; p->x[1][0] = x[7]; p->y[1][0] = y[7]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = patchesA[nPatchesA-1].color[0][1].c[j]; p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][1].c[j]; p->color[1][1].c[j] = c[0][j]; p->color[1][0].c[j] = c[1][j]; } break; case 2: p->x[0][0] = patchesA[nPatchesA-1].x[3][3]; p->y[0][0] = patchesA[nPatchesA-1].y[3][3]; p->x[0][1] = patchesA[nPatchesA-1].x[3][2]; p->y[0][1] = patchesA[nPatchesA-1].y[3][2]; p->x[0][2] = patchesA[nPatchesA-1].x[3][1]; p->y[0][2] = patchesA[nPatchesA-1].y[3][1]; p->x[0][3] = patchesA[nPatchesA-1].x[3][0]; p->y[0][3] = patchesA[nPatchesA-1].y[3][0]; p->x[1][3] = x[0]; p->y[1][3] = y[0]; p->x[2][3] = x[1]; p->y[2][3] = y[1]; p->x[3][3] = x[2]; p->y[3][3] = y[2]; p->x[3][2] = x[3]; p->y[3][2] = y[3]; p->x[3][1] = x[4]; p->y[3][1] = y[4]; p->x[3][0] = x[5]; p->y[3][0] = y[5]; p->x[2][0] = x[6]; p->y[2][0] = y[6]; p->x[1][0] = x[7]; p->y[1][0] = y[7]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][1].c[j]; p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j]; p->color[1][1].c[j] = c[0][j]; p->color[1][0].c[j] = c[1][j]; } break; case 3: p->x[0][0] = patchesA[nPatchesA-1].x[3][0]; p->y[0][0] = patchesA[nPatchesA-1].y[3][0]; p->x[0][1] = patchesA[nPatchesA-1].x[2][0]; p->y[0][1] = patchesA[nPatchesA-1].y[2][0]; p->x[0][2] = patchesA[nPatchesA-1].x[1][0]; p->y[0][2] = patchesA[nPatchesA-1].y[1][0]; p->x[0][3] = patchesA[nPatchesA-1].x[0][0]; p->y[0][3] = patchesA[nPatchesA-1].y[0][0]; p->x[1][3] = x[0]; p->y[1][3] = y[0]; p->x[2][3] = x[1]; p->y[2][3] = y[1]; p->x[3][3] = x[2]; p->y[3][3] = y[2]; p->x[3][2] = x[3]; p->y[3][2] = y[3]; p->x[3][1] = x[4]; p->y[3][1] = y[4]; p->x[3][0] = x[5]; p->y[3][0] = y[5]; p->x[2][0] = x[6]; p->y[2][0] = y[6]; p->x[1][0] = x[7]; p->y[1][0] = y[7]; for (j = 0; j < nComps; ++j) { p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j]; p->color[0][1].c[j] = patchesA[nPatchesA-1].color[0][0].c[j]; p->color[1][1].c[j] = c[0][j]; p->color[1][0].c[j] = c[1][j]; } break; } } else { switch (flag) { case 0: p->x[0][0] = x[0]; p->y[0][0] = y[0]; p->x[0][1] = x[1]; p->y[0][1] = y[1]; p->x[0][2] = x[2]; p->y[0][2] = y[2]; p->x[0][3] = x[3]; p->y[0][3] = y[3]; p->x[1][3] = x[4]; p->y[1][3] = y[4]; p->x[2][3] = x[5]; p->y[2][3] = y[5]; p->x[3][3] = x[6]; p->y[3][3] = y[6]; p->x[3][2] = x[7]; p->y[3][2] = y[7]; p->x[3][1] = x[8]; p->y[3][1] = y[8]; p->x[3][0] = x[9]; p->y[3][0] = y[9]; p->x[2][0] = x[10]; p->y[2][0] = y[10]; p->x[1][0] = x[11]; p->y[1][0] = y[11]; p->x[1][1] = x[12]; p->y[1][1] = y[12]; p->x[1][2] = x[13]; p->y[1][2] = y[13]; p->x[2][2] = x[14]; p->y[2][2] = y[14]; p->x[2][1] = x[15]; p->y[2][1] = y[15]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = c[0][j]; p->color[0][1].c[j] = c[1][j]; p->color[1][1].c[j] = c[2][j]; p->color[1][0].c[j] = c[3][j]; } break; case 1: p->x[0][0] = patchesA[nPatchesA-1].x[0][3]; p->y[0][0] = patchesA[nPatchesA-1].y[0][3]; p->x[0][1] = patchesA[nPatchesA-1].x[1][3]; p->y[0][1] = patchesA[nPatchesA-1].y[1][3]; p->x[0][2] = patchesA[nPatchesA-1].x[2][3]; p->y[0][2] = patchesA[nPatchesA-1].y[2][3]; p->x[0][3] = patchesA[nPatchesA-1].x[3][3]; p->y[0][3] = patchesA[nPatchesA-1].y[3][3]; p->x[1][3] = x[0]; p->y[1][3] = y[0]; p->x[2][3] = x[1]; p->y[2][3] = y[1]; p->x[3][3] = x[2]; p->y[3][3] = y[2]; p->x[3][2] = x[3]; p->y[3][2] = y[3]; p->x[3][1] = x[4]; p->y[3][1] = y[4]; p->x[3][0] = x[5]; p->y[3][0] = y[5]; p->x[2][0] = x[6]; p->y[2][0] = y[6]; p->x[1][0] = x[7]; p->y[1][0] = y[7]; p->x[1][1] = x[8]; p->y[1][1] = y[8]; p->x[1][2] = x[9]; p->y[1][2] = y[9]; p->x[2][2] = x[10]; p->y[2][2] = y[10]; p->x[2][1] = x[11]; p->y[2][1] = y[11]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = patchesA[nPatchesA-1].color[0][1].c[j]; p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][1].c[j]; p->color[1][1].c[j] = c[0][j]; p->color[1][0].c[j] = c[1][j]; } break; case 2: p->x[0][0] = patchesA[nPatchesA-1].x[3][3]; p->y[0][0] = patchesA[nPatchesA-1].y[3][3]; p->x[0][1] = patchesA[nPatchesA-1].x[3][2]; p->y[0][1] = patchesA[nPatchesA-1].y[3][2]; p->x[0][2] = patchesA[nPatchesA-1].x[3][1]; p->y[0][2] = patchesA[nPatchesA-1].y[3][1]; p->x[0][3] = patchesA[nPatchesA-1].x[3][0]; p->y[0][3] = patchesA[nPatchesA-1].y[3][0]; p->x[1][3] = x[0]; p->y[1][3] = y[0]; p->x[2][3] = x[1]; p->y[2][3] = y[1]; p->x[3][3] = x[2]; p->y[3][3] = y[2]; p->x[3][2] = x[3]; p->y[3][2] = y[3]; p->x[3][1] = x[4]; p->y[3][1] = y[4]; p->x[3][0] = x[5]; p->y[3][0] = y[5]; p->x[2][0] = x[6]; p->y[2][0] = y[6]; p->x[1][0] = x[7]; p->y[1][0] = y[7]; p->x[1][1] = x[8]; p->y[1][1] = y[8]; p->x[1][2] = x[9]; p->y[1][2] = y[9]; p->x[2][2] = x[10]; p->y[2][2] = y[10]; p->x[2][1] = x[11]; p->y[2][1] = y[11]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][1].c[j]; p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j]; p->color[1][1].c[j] = c[0][j]; p->color[1][0].c[j] = c[1][j]; } break; case 3: p->x[0][0] = patchesA[nPatchesA-1].x[3][0]; p->y[0][0] = patchesA[nPatchesA-1].y[3][0]; p->x[0][1] = patchesA[nPatchesA-1].x[2][0]; p->y[0][1] = patchesA[nPatchesA-1].y[2][0]; p->x[0][2] = patchesA[nPatchesA-1].x[1][0]; p->y[0][2] = patchesA[nPatchesA-1].y[1][0]; p->x[0][3] = patchesA[nPatchesA-1].x[0][0]; p->y[0][3] = patchesA[nPatchesA-1].y[0][0]; p->x[1][3] = x[0]; p->y[1][3] = y[0]; p->x[2][3] = x[1]; p->y[2][3] = y[1]; p->x[3][3] = x[2]; p->y[3][3] = y[2]; p->x[3][2] = x[3]; p->y[3][2] = y[3]; p->x[3][1] = x[4]; p->y[3][1] = y[4]; p->x[3][0] = x[5]; p->y[3][0] = y[5]; p->x[2][0] = x[6]; p->y[2][0] = y[6]; p->x[1][0] = x[7]; p->y[1][0] = y[7]; p->x[1][1] = x[8]; p->y[1][1] = y[8]; p->x[1][2] = x[9]; p->y[1][2] = y[9]; p->x[2][2] = x[10]; p->y[2][2] = y[10]; p->x[2][1] = x[11]; p->y[2][1] = y[11]; for (j = 0; j < nComps; ++j) { p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][0].c[j]; p->color[0][1].c[j] = patchesA[nPatchesA-1].color[0][0].c[j]; p->color[1][1].c[j] = c[0][j]; p->color[1][0].c[j] = c[1][j]; } break; } } ++nPatchesA; bitBuf->flushBits(); } delete bitBuf; if (typeA == 6) { for (i = 0; i < nPatchesA; ++i) { p = &patchesA[i]; p->x[1][1] = (-4 * p->x[0][0] +6 * (p->x[0][1] + p->x[1][0]) -2 * (p->x[0][3] + p->x[3][0]) +3 * (p->x[3][1] + p->x[1][3]) - p->x[3][3]) / 9; p->y[1][1] = (-4 * p->y[0][0] +6 * (p->y[0][1] + p->y[1][0]) -2 * (p->y[0][3] + p->y[3][0]) +3 * (p->y[3][1] + p->y[1][3]) - p->y[3][3]) / 9; p->x[1][2] = (-4 * p->x[0][3] +6 * (p->x[0][2] + p->x[1][3]) -2 * (p->x[0][0] + p->x[3][3]) +3 * (p->x[3][2] + p->x[1][0]) - p->x[3][0]) / 9; p->y[1][2] = (-4 * p->y[0][3] +6 * (p->y[0][2] + p->y[1][3]) -2 * (p->y[0][0] + p->y[3][3]) +3 * (p->y[3][2] + p->y[1][0]) - p->y[3][0]) / 9; p->x[2][1] = (-4 * p->x[3][0] +6 * (p->x[3][1] + p->x[2][0]) -2 * (p->x[3][3] + p->x[0][0]) +3 * (p->x[0][1] + p->x[2][3]) - p->x[0][3]) / 9; p->y[2][1] = (-4 * p->y[3][0] +6 * (p->y[3][1] + p->y[2][0]) -2 * (p->y[3][3] + p->y[0][0]) +3 * (p->y[0][1] + p->y[2][3]) - p->y[0][3]) / 9; p->x[2][2] = (-4 * p->x[3][3] +6 * (p->x[3][2] + p->x[2][3]) -2 * (p->x[3][0] + p->x[0][3]) +3 * (p->x[0][2] + p->x[2][0]) - p->x[0][0]) / 9; p->y[2][2] = (-4 * p->y[3][3] +6 * (p->y[3][2] + p->y[2][3]) -2 * (p->y[3][0] + p->y[0][3]) +3 * (p->y[0][2] + p->y[2][0]) - p->y[0][0]) / 9; } } shading = new GfxPatchMeshShading(typeA, patchesA, nPatchesA, funcsA, nFuncsA); if (!shading->init(dict)) { delete shading; return NULL; } return shading; err2: obj1.free(); err1: return NULL; }
CWE-189
1,107
11,695
206056248377323080841446708233611571590
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GBool GfxState::parseBlendMode(Object *obj, GfxBlendMode *mode) { Object obj2; int i, j; if (obj->isName()) { for (i = 0; i < nGfxBlendModeNames; ++i) { if (!strcmp(obj->getName(), gfxBlendModeNames[i].name)) { *mode = gfxBlendModeNames[i].mode; return gTrue; } } return gFalse; } else if (obj->isArray()) { for (i = 0; i < obj->arrayGetLength(); ++i) { obj->arrayGet(i, &obj2); if (!obj2.isName()) { obj2.free(); return gFalse; } for (j = 0; j < nGfxBlendModeNames; ++j) { if (!strcmp(obj2.getName(), gfxBlendModeNames[j].name)) { obj2.free(); *mode = gfxBlendModeNames[j].mode; return gTrue; } } obj2.free(); } *mode = gfxBlendNormal; return gTrue; } else { return gFalse; } }
CWE-189
1,108
11,696
160106197126143467121566144671627498919
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxICCBasedCache::put(int numA, int genA, GfxICCBasedColorSpace *cs) { int i; if (cache[GFX_ICCBASED_CACHE_SIZE-1].num > 0) { delete cache[GFX_ICCBASED_CACHE_SIZE-1].colorSpace; } for (i = GFX_ICCBASED_CACHE_SIZE-1; i > 0; i--) { if (cache[i - 1].num > 0) cache[i] = cache[i - 1]; } cache[0].num = numA; cache[0].gen = genA; cache[0].colorSpace = (GfxICCBasedColorSpace *)cs->copy(); }
CWE-189
1,109
11,697
9083761534178037847271576468780997030
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxState *GfxState::save() { GfxState *newState; newState = copy(); newState->saved = this; return newState; }
CWE-189
1,111
11,698
337935132107296269086532100080987023936
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setFillColorSpace(GfxColorSpace *colorSpace) { if (fillColorSpace) { delete fillColorSpace; } fillColorSpace = colorSpace; }
CWE-189
1,113
11,699
3893737826662257746814451566792262851
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setFont(GfxFont *fontA, double fontSizeA) { if (font) font->decRefCnt(); font = fontA; fontSize = fontSizeA; }
CWE-189
1,115
11,700
146781749380847583349621441971402490823
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setLineDash(double *dash, int length, double start) { if (lineDash) gfree(lineDash); lineDash = dash; lineDashLength = length; lineDashStart = start; }
CWE-189
1,116
11,701
88016875500650939085911935630878313940
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setPath(GfxPath *pathA) { delete path; path = pathA; }
CWE-189
1,117
11,702
299043986289212937903186003467655145387
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setStrokeColorSpace(GfxColorSpace *colorSpace) { if (strokeColorSpace) { delete strokeColorSpace; } strokeColorSpace = colorSpace; }
CWE-189
1,118
11,703
23755622045504594740129412885616236617
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setStrokePattern(GfxPattern *pattern) { if (strokePattern) { delete strokePattern; } strokePattern = pattern; }
CWE-189
1,119
11,704
26863679890007433772304800861627673298
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::setTransfer(Function **funcs) { int i; for (i = 0; i < 4; ++i) { if (transfer[i]) { delete transfer[i]; } transfer[i] = funcs[i]; } }
CWE-189
1,120
11,705
74763513933863847574916775981396285513
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
int GfxColorSpace::setupColorProfiles() { static GBool initialized = gFalse; cmsHTRANSFORM transform; unsigned int nChannels; if (initialized) return 0; initialized = gTrue; cmsSetErrorHandler(CMSError); if (displayProfile == NULL) { if (displayProfileName == NULL) { displayProfile = loadColorProfile("display.icc"); } else if (displayProfileName->getLength() > 0) { displayProfile = loadColorProfile(displayProfileName->getCString()); } } RGBProfile = loadColorProfile("RGB.icc"); if (RGBProfile == NULL) { /* use built in sRGB profile */ RGBProfile = cmsCreate_sRGBProfile(); } if (displayProfile != NULL) { displayPixelType = getCMSColorSpaceType(cmsGetColorSpace(displayProfile)); nChannels = getCMSNChannels(cmsGetColorSpace(displayProfile)); cmsHPROFILE XYZProfile = cmsCreateXYZProfile(); if ((transform = cmsCreateTransform(XYZProfile, TYPE_XYZ_DBL, displayProfile, COLORSPACE_SH(displayPixelType) | CHANNELS_SH(nChannels) | BYTES_SH(1), INTENT_RELATIVE_COLORIMETRIC,0)) == 0) { error(-1, "Can't create Lab transform"); } else { XYZ2DisplayTransform = new GfxColorTransform(transform); } cmsCloseProfile(XYZProfile); } return 0; }
CWE-189
1,121
11,706
193879570204416277496400849548516333499
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::shift(double dx, double dy) { curX += dx; curY += dy; }
CWE-189
1,122
11,707
48667965022646478566241978537604775532
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::shiftCTM(double tx, double ty) { ctm[4] += tx; ctm[5] += ty; clipXMin += tx; clipYMin += ty; clipXMax += tx; clipYMax += ty; }
CWE-189
1,123
11,708
332720304956369420872520770733414453690
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void GfxState::textShift(double tx, double ty) { double dx, dy; textTransformDelta(tx, ty, &dx, &dy); curX += dx; curY += dy; }
CWE-189
1,124
11,709
3157650662467190840468866232065780517
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void Matrix::transform(double x, double y, double *tx, double *ty) { double temp_x, temp_y; temp_x = m[0] * x + m[2] * y + m[4]; temp_y = m[1] * x + m[3] * y + m[5]; *tx = temp_x; *ty = temp_y; }
CWE-189
1,125
11,710
152841174005119933724536662125384529779
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxAxialShading::~GfxAxialShading() { int i; for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
CWE-189
1,127
11,711
263447032064024503669076268189877862382
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxCalGrayColorSpace::~GfxCalGrayColorSpace() { }
CWE-189
1,128
11,712
320309545442298205992541150062702015902
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxCalRGBColorSpace::~GfxCalRGBColorSpace() { }
CWE-189
1,129
11,713
1658029194651040503331559000407680691
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxColorSpace::~GfxColorSpace() { }
CWE-189
1,130
11,714
4464421985753548766159209773655735170
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxDeviceCMYKColorSpace::~GfxDeviceCMYKColorSpace() { }
CWE-189
1,131
11,715
19906277862383520976021537785678069786
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxDeviceGrayColorSpace::~GfxDeviceGrayColorSpace() { }
CWE-189
1,132
11,716
217748651203271824681565589429933198226
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxDeviceNColorSpace::~GfxDeviceNColorSpace() { int i; for (i = 0; i < nComps; ++i) { delete names[i]; } delete alt; delete func; }
CWE-189
1,133
11,717
105053131147449448107751839594699464687
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxDeviceRGBColorSpace::~GfxDeviceRGBColorSpace() { }
CWE-189
1,134
11,718
225756673174927069396355829403433995521
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxFunctionShading::~GfxFunctionShading() { int i; for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
CWE-189
1,135
11,719
31205125463615714447876530785712872151
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxGouraudTriangleShading::~GfxGouraudTriangleShading() { int i; gfree(vertices); gfree(triangles); for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
CWE-189
1,136
11,720
321245086922197074710631162437485194082
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxICCBasedColorSpace::~GfxICCBasedColorSpace() { delete alt; #ifdef USE_CMS if (transform != NULL) { if (transform->unref() == 0) delete transform; } if (lineTransform != NULL) { if (lineTransform->unref() == 0) delete lineTransform; } #endif }
CWE-189
1,137
11,721
224045329848070013569029870560811452691
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxImageColorMap::~GfxImageColorMap() { int i; delete colorSpace; for (i = 0; i < gfxColorMaxComps; ++i) { gfree(lookup[i]); } gfree(byte_lookup); }
CWE-189
1,138
11,722
277370518156180113317134956835506253515
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxIndexedColorSpace::~GfxIndexedColorSpace() { delete base; gfree(lookup); }
CWE-189
1,139
11,723
191603950117453557030717664435204862615
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxLabColorSpace::~GfxLabColorSpace() { }
CWE-189
1,140
11,724
130047786677678670910775165935700430489
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxPatchMeshShading::~GfxPatchMeshShading() { int i; gfree(patches); for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
CWE-189
1,141
11,725
41748397199833490073229853775480223478
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxPath::~GfxPath() { int i; for (i = 0; i < n; ++i) delete subpaths[i]; gfree(subpaths); }
CWE-189
1,142
11,726
22158117122197487766940631911667806267
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxPattern::~GfxPattern() { }
CWE-189
1,143
11,727
233506755207058045604788443485099995805
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxPatternColorSpace::~GfxPatternColorSpace() { if (under) { delete under; } }
CWE-189
1,144
11,728
39343207576649183858324788067214790386
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxRadialShading::~GfxRadialShading() { int i; for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
CWE-189
1,145
11,729
273899470459084107520668599723698634173
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxShading::~GfxShading() { if (colorSpace) { delete colorSpace; } }
CWE-189
1,147
11,730
14256555041335306139943865012592490439
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxShadingBitBuf::~GfxShadingBitBuf() { str->close(); }
CWE-189
1,148
11,731
77933657537849503101474429151638143284
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxShadingPattern::~GfxShadingPattern() { delete shading; }
CWE-189
1,149
11,732
289360171358650243398837484904894136238
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
GfxSubpath::~GfxSubpath() { gfree(x); gfree(y); gfree(curve); }
CWE-189
1,151
11,733
296058820086693014805730490565548765163
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2CodeTable::JBIG2CodeTable(Guint segNumA, JBIG2HuffmanTable *tableA): JBIG2Segment(segNumA) { table = tableA; }
CWE-189
1,153
11,734
28269530307054728934889664645882159738
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2HuffmanDecoder::JBIG2HuffmanDecoder() { str = NULL; reset(); }
CWE-189
1,154
11,735
201200835847730037506694324995030030817
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2MMRDecoder::JBIG2MMRDecoder() { str = NULL; reset(); }
CWE-189
1,155
11,736
231141987891569922449149779423100482175
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2PatternDict::JBIG2PatternDict(Guint segNumA, Guint sizeA): JBIG2Segment(segNumA) { size = sizeA; bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *)); }
CWE-189
1,156
11,737
280908559627476911422241647120528421628
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2Segment(Guint segNumA) { segNum = segNumA; }
CWE-189
1,157
11,738
145598375085215268410783119935732874688
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2Stream::JBIG2Stream(Stream *strA, Object *globalsStreamA): FilterStream(strA) { pageBitmap = NULL; arithDecoder = new JArithmeticDecoder(); genericRegionStats = new JArithmeticDecoderStats(1 << 1); refinementRegionStats = new JArithmeticDecoderStats(1 << 1); iadhStats = new JArithmeticDecoderStats(1 << 9); iadwStats = new JArithmeticDecoderStats(1 << 9); iaexStats = new JArithmeticDecoderStats(1 << 9); iaaiStats = new JArithmeticDecoderStats(1 << 9); iadtStats = new JArithmeticDecoderStats(1 << 9); iaitStats = new JArithmeticDecoderStats(1 << 9); iafsStats = new JArithmeticDecoderStats(1 << 9); iadsStats = new JArithmeticDecoderStats(1 << 9); iardxStats = new JArithmeticDecoderStats(1 << 9); iardyStats = new JArithmeticDecoderStats(1 << 9); iardwStats = new JArithmeticDecoderStats(1 << 9); iardhStats = new JArithmeticDecoderStats(1 << 9); iariStats = new JArithmeticDecoderStats(1 << 9); iaidStats = new JArithmeticDecoderStats(1 << 1); huffDecoder = new JBIG2HuffmanDecoder(); mmrDecoder = new JBIG2MMRDecoder(); globalsStreamA->copy(&globalsStream); segments = globalSegments = NULL; curStr = NULL; dataPtr = dataEnd = NULL; }
CWE-189
1,158
11,739
245077798346376936260026177584107052954
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2SymbolDict::JBIG2SymbolDict(Guint segNumA, Guint sizeA): JBIG2Segment(segNumA) { size = sizeA; bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *)); genericRegionStats = NULL; refinementRegionStats = NULL; }
CWE-189
1,159
11,740
338578741306669053349737917534671221484
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void JBIG2HuffmanDecoder::buildTable(JBIG2HuffmanTable *table, Guint len) { Guint i, j, k, prefix; JBIG2HuffmanTable tab; for (i = 0; i < len; ++i) { for (j = i; j < len && table[j].prefixLen == 0; ++j) ; if (j == len) { break; } for (k = j + 1; k < len; ++k) { if (table[k].prefixLen > 0 && table[k].prefixLen < table[j].prefixLen) { j = k; } } if (j != i) { tab = table[j]; for (k = j; k > i; --k) { table[k] = table[k - 1]; } table[i] = tab; } } table[i] = table[len]; i = 0; prefix = 0; table[i++].prefix = prefix++; for (; table[i].rangeLen != jbig2HuffmanEOT; ++i) { prefix <<= table[i].prefixLen - table[i-1].prefixLen; table[i].prefix = prefix++; } }
CWE-189
1,160
11,741
294061745147266093554873396133950353680
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void clearPixel(int x, int y) { data[y * line + (x >> 3)] &= 0x7f7f >> (x & 7); }
CWE-189
1,161
11,742
288637281455629951030426365166662252450
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void JBIG2Bitmap::clearToOne() { memset(data, 0xff, h * line); }
CWE-189
1,162
11,743
22362725015915087941027244890459037419
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void JBIG2Bitmap::clearToZero() { memset(data, 0, h * line); }
CWE-189
1,163
11,744
239031781185621494226263882535035140216
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void JBIG2Stream::close() { if (pageBitmap) { delete pageBitmap; pageBitmap = NULL; } if (segments) { deleteGooList(segments, JBIG2Segment); segments = NULL; } if (globalSegments) { deleteGooList(globalSegments, JBIG2Segment); globalSegments = NULL; } dataPtr = dataEnd = NULL; FilterStream::close(); }
CWE-189
1,164
11,745
242279481818138708689032750401632839252
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp) { int x0, x1, y0, y1, xx, yy; Guchar *srcPtr, *destPtr; Guint src0, src1, src, dest, s1, s2, m1, m2, m3; GBool oneByte; if (y < 0) { y0 = -y; } else { y0 = 0; } if (y + bitmap->h > h) { y1 = h - y; } else { y1 = bitmap->h; } if (y0 >= y1) { return; } if (x >= 0) { x0 = x & ~7; } else { x0 = 0; } x1 = x + bitmap->w; if (x1 > w) { x1 = w; } if (x0 >= x1) { return; } s1 = x & 7; s2 = 8 - s1; m1 = 0xff >> (x1 & 7); m2 = 0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7)); m3 = (0xff >> s1) & m2; oneByte = x0 == ((x1 - 1) & ~7); for (yy = y0; yy < y1; ++yy) { if (oneByte) { if (x >= 0) { destPtr = data + (y + yy) * line + (x >> 3); srcPtr = bitmap->data + yy * bitmap->line; dest = *destPtr; src1 = *srcPtr; switch (combOp) { case 0: // or dest |= (src1 >> s1) & m2; break; case 1: // and dest &= ((0xff00 | src1) >> s1) | m1; break; case 2: // xor dest ^= (src1 >> s1) & m2; break; case 3: // xnor dest ^= ((src1 ^ 0xff) >> s1) & m2; break; case 4: // replace dest = (dest & ~m3) | ((src1 >> s1) & m3); break; } *destPtr = dest; } else { destPtr = data + (y + yy) * line; srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3); dest = *destPtr; src1 = *srcPtr; switch (combOp) { case 0: // or dest |= src1 & m2; break; case 1: // and dest &= src1 | m1; break; case 2: // xor dest ^= src1 & m2; break; case 3: // xnor dest ^= (src1 ^ 0xff) & m2; break; case 4: // replace dest = (src1 & m2) | (dest & m1); break; } *destPtr = dest; } } else { if (x >= 0) { destPtr = data + (y + yy) * line + (x >> 3); srcPtr = bitmap->data + yy * bitmap->line; src1 = *srcPtr++; dest = *destPtr; switch (combOp) { case 0: // or dest |= src1 >> s1; break; case 1: // and dest &= (0xff00 | src1) >> s1; break; case 2: // xor dest ^= src1 >> s1; break; case 3: // xnor dest ^= (src1 ^ 0xff) >> s1; break; case 4: // replace dest = (dest & (0xff << s2)) | (src1 >> s1); break; } *destPtr++ = dest; xx = x0 + 8; } else { destPtr = data + (y + yy) * line; srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3); src1 = *srcPtr++; xx = x0; } for (; xx < x1 - 8; xx += 8) { dest = *destPtr; src0 = src1; src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; switch (combOp) { case 0: // or dest |= src; break; case 1: // and dest &= src; break; case 2: // xor dest ^= src; break; case 3: // xnor dest ^= src ^ 0xff; break; case 4: // replace dest = src; break; } *destPtr++ = dest; } dest = *destPtr; src0 = src1; src1 = *srcPtr++; src = (((src0 << 8) | src1) >> s1) & 0xff; switch (combOp) { case 0: // or dest |= src & m2; break; case 1: // and dest &= src | m1; break; case 2: // xor dest ^= src & m2; break; case 3: // xnor dest ^= (src ^ 0xff) & m2; break; case 4: // replace dest = (src & m2) | (dest & m1); break; } *destPtr = dest; } } }
CWE-189
1,165
11,746
13619673610865681092953041820743491675
null
null
null
poppler
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
0
JBIG2Bitmap *copy() { return new JBIG2Bitmap(0, this); }
CWE-189
1,166
11,747
235720837331214984241222227240670711942
null
null
null