idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
700
CairoOutputDev::CairoOutputDev() { xref = NULL; catalog = NULL; if (!ft_lib_initialized) { FT_Init_FreeType(&ft_lib); ft_lib_initialized = gTrue; } fontEngine = NULL; fontEngine_owner = gFalse; glyphs = NULL; fill_pattern = NULL; stroke_pattern = NULL; stroke_opacity = 1.0; fill_opacity = 1.0; textClipPath = NULL; cairo = NULL; currentFont = NULL; prescaleImages = gTrue; printing = gTrue; inType3Char = gFalse; t3_glyph_has_bbox = gFalse; groupColorSpaceStack = NULL; maskStack = NULL; group = NULL; mask = NULL; shape = NULL; cairo_shape = NULL; knockoutCount = 0; text = NULL; actualText = NULL; }
DoS Exec Code Overflow
0
CairoOutputDev::CairoOutputDev() { xref = NULL; catalog = NULL; if (!ft_lib_initialized) { FT_Init_FreeType(&ft_lib); ft_lib_initialized = gTrue; } fontEngine = NULL; fontEngine_owner = gFalse; glyphs = NULL; fill_pattern = NULL; stroke_pattern = NULL; stroke_opacity = 1.0; fill_opacity = 1.0; textClipPath = NULL; cairo = NULL; currentFont = NULL; prescaleImages = gTrue; printing = gTrue; inType3Char = gFalse; t3_glyph_has_bbox = gFalse; groupColorSpaceStack = NULL; maskStack = NULL; group = NULL; mask = NULL; shape = NULL; cairo_shape = NULL; knockoutCount = 0; text = NULL; actualText = NULL; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
701
void CairoOutputDev::beginMarkedContent(char *name, Dict *properties) { if (text) actualText->beginMC(properties); }
DoS Exec Code Overflow
0
void CairoOutputDev::beginMarkedContent(char *name, Dict *properties) { if (text) actualText->beginMC(properties); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
702
void CairoOutputDev::clearSoftMask(GfxState * /*state*/) { if (mask) cairo_pattern_destroy(mask); mask = NULL; }
DoS Exec Code Overflow
0
void CairoOutputDev::clearSoftMask(GfxState * /*state*/) { if (mask) cairo_pattern_destroy(mask); mask = NULL; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
703
void CairoOutputDev::clip(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING); cairo_clip (cairo); LOG (printf ("clip\n")); if (cairo_shape) { doPath (cairo_shape, state, state->getPath()); cairo_set_fill_rule (cairo_shape, CAIRO_FILL_RULE_WINDING); cairo_clip (cairo_shape); } }
DoS Exec Code Overflow
0
void CairoOutputDev::clip(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING); cairo_clip (cairo); LOG (printf ("clip\n")); if (cairo_shape) { doPath (cairo_shape, state, state->getPath()); cairo_set_fill_rule (cairo_shape, CAIRO_FILL_RULE_WINDING); cairo_clip (cairo_shape); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
704
void CairoOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen) { if (currentFont) { glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen); glyphs[glyphCount].x = x - originX; glyphs[glyphCount].y = y - originY; glyphCount++; } if (!text) return; actualText->addChar (state, x, y, dx, dy, code, nBytes, u, uLen); }
DoS Exec Code Overflow
0
void CairoOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen) { if (currentFont) { glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen); glyphs[glyphCount].x = x - originX; glyphs[glyphCount].y = y - originY; glyphCount++; } if (!text) return; actualText->addChar (state, x, y, dx, dy, code, nBytes, u, uLen); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
705
void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; double *ctm; double mat[6]; CairoImage *image; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; x1 = mat[4]; y1 = mat[5]; x2 = x1 + width; y2 = y1 + height; image = new CairoImage (x1, y1, x2, y2); saveImage (image); if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); setCairo (cr); cairo_translate (cr, 0, height); cairo_scale (cr, width, -height); CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); image->setImage (surface); setCairo (NULL); cairo_surface_destroy (surface); cairo_destroy (cr); } }
DoS Exec Code Overflow
0
void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; double *ctm; double mat[6]; CairoImage *image; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; x1 = mat[4]; y1 = mat[5]; x2 = x1 + width; y2 = y1 + height; image = new CairoImage (x1, y1, x2, y2); saveImage (image); if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); setCairo (cr); cairo_translate (cr, 0, height); cairo_scale (cr, width, -height); CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); image->setImage (surface); setCairo (NULL); cairo_surface_destroy (surface); cairo_destroy (cr); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
706
void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { /* FIXME: Doesn't the image mask support any colorspace? */ cairo_set_source (cairo, fill_pattern); /* work around a cairo bug when scaling 1x1 surfaces */ if (width == 1 && height == 1) { cairo_save (cairo); cairo_rectangle (cairo, 0., 0., width, height); cairo_fill (cairo); cairo_restore (cairo); if (cairo_shape) { cairo_save (cairo_shape); cairo_rectangle (cairo_shape, 0., 0., width, height); cairo_fill (cairo_shape); cairo_restore (cairo_shape); } return; } /* shape is 1.0 for painted areas, 0.0 for unpainted ones */ cairo_matrix_t matrix; cairo_get_matrix (cairo, &matrix); if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) { drawImageMaskPrescaled(state, ref, str, width, height, invert, inlineImg); } else { drawImageMaskRegular(state, ref, str, width, height, invert, inlineImg); } }
DoS Exec Code Overflow
0
void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { /* FIXME: Doesn't the image mask support any colorspace? */ cairo_set_source (cairo, fill_pattern); /* work around a cairo bug when scaling 1x1 surfaces */ if (width == 1 && height == 1) { cairo_save (cairo); cairo_rectangle (cairo, 0., 0., width, height); cairo_fill (cairo); cairo_restore (cairo); if (cairo_shape) { cairo_save (cairo_shape); cairo_rectangle (cairo_shape, 0., 0., width, height); cairo_fill (cairo_shape); cairo_restore (cairo_shape); } return; } /* shape is 1.0 for painted areas, 0.0 for unpainted ones */ cairo_matrix_t matrix; cairo_get_matrix (cairo, &matrix); if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) { drawImageMaskPrescaled(state, ref, str, width, height, invert, inlineImg); } else { drawImageMaskRegular(state, ref, str, width, height, invert, inlineImg); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
707
void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { unsigned char *buffer; unsigned char *dest; cairo_surface_t *image; cairo_pattern_t *pattern; int x, y; ImageStream *imgStr; Guchar *pix; cairo_matrix_t matrix; int invert_bit; int row_stride; row_stride = (width + 3) & ~3; buffer = (unsigned char *) malloc (height * row_stride); if (buffer == NULL) { error(-1, "Unable to allocate memory for image."); return; } /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, 1, 1); imgStr->reset(); invert_bit = invert ? 1 : 0; for (y = 0; y < height; y++) { pix = imgStr->getLine(); dest = buffer + y * row_stride; for (x = 0; x < width; x++) { if (pix[x] ^ invert_bit) *dest++ = 0; else *dest++ = 255; } } image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_A8, width, height, row_stride); if (image == NULL) { delete imgStr; return; } pattern = cairo_pattern_create_for_surface (image); if (pattern == NULL) { delete imgStr; return; } cairo_matrix_init_translate (&matrix, 0, height); cairo_matrix_scale (&matrix, width, -height); cairo_pattern_set_matrix (pattern, &matrix); /* we should actually be using CAIRO_FILTER_NEAREST here. However, * cairo doesn't yet do minifaction filtering causing scaled down * images with CAIRO_FILTER_NEAREST to look really bad */ cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST); cairo_mask (cairo, pattern); if (cairo_shape) { #if 0 cairo_rectangle (cairo_shape, 0., 0., width, height); cairo_fill (cairo_shape); #else cairo_save (cairo_shape); /* this should draw a rectangle the size of the image * we use this instead of rect,fill because of the lack * of EXTEND_PAD */ /* NOTE: this will multiply the edges of the image twice */ cairo_set_source (cairo_shape, pattern); cairo_mask (cairo_shape, pattern); cairo_restore (cairo_shape); #endif } cairo_pattern_destroy (pattern); cairo_surface_destroy (image); free (buffer); delete imgStr; }
DoS Exec Code Overflow
0
void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) { unsigned char *buffer; unsigned char *dest; cairo_surface_t *image; cairo_pattern_t *pattern; int x, y; ImageStream *imgStr; Guchar *pix; cairo_matrix_t matrix; int invert_bit; int row_stride; row_stride = (width + 3) & ~3; buffer = (unsigned char *) malloc (height * row_stride); if (buffer == NULL) { error(-1, "Unable to allocate memory for image."); return; } /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, 1, 1); imgStr->reset(); invert_bit = invert ? 1 : 0; for (y = 0; y < height; y++) { pix = imgStr->getLine(); dest = buffer + y * row_stride; for (x = 0; x < width; x++) { if (pix[x] ^ invert_bit) *dest++ = 0; else *dest++ = 255; } } image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_A8, width, height, row_stride); if (image == NULL) { delete imgStr; return; } pattern = cairo_pattern_create_for_surface (image); if (pattern == NULL) { delete imgStr; return; } cairo_matrix_init_translate (&matrix, 0, height); cairo_matrix_scale (&matrix, width, -height); cairo_pattern_set_matrix (pattern, &matrix); /* we should actually be using CAIRO_FILTER_NEAREST here. However, * cairo doesn't yet do minifaction filtering causing scaled down * images with CAIRO_FILTER_NEAREST to look really bad */ cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST); cairo_mask (cairo, pattern); if (cairo_shape) { #if 0 cairo_rectangle (cairo_shape, 0., 0., width, height); cairo_fill (cairo_shape); #else cairo_save (cairo_shape); /* this should draw a rectangle the size of the image * we use this instead of rect,fill because of the lack * of EXTEND_PAD */ /* NOTE: this will multiply the edges of the image twice */ cairo_set_source (cairo_shape, pattern); cairo_mask (cairo_shape, pattern); cairo_restore (cairo_shape); #endif } cairo_pattern_destroy (pattern); cairo_surface_destroy (image); free (buffer); delete imgStr; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
708
void CairoOutputDev::drawLink(Link *link, Catalog *catalog) { }
DoS Exec Code Overflow
0
void CairoOutputDev::drawLink(Link *link, Catalog *catalog) { }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
709
void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; double *ctm; double mat[6]; CairoImage *image; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; x1 = mat[4]; y1 = mat[5]; x2 = x1 + width; y2 = y1 + height; image = new CairoImage (x1, y1, x2, y2); saveImage (image); if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); setCairo (cr); cairo_translate (cr, 0, height); cairo_scale (cr, width, -height); CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskInvert); image->setImage (surface); setCairo (NULL); cairo_surface_destroy (surface); cairo_destroy (cr); } }
DoS Exec Code Overflow
0
void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; double *ctm; double mat[6]; CairoImage *image; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; x1 = mat[4]; y1 = mat[5]; x2 = x1 + width; y2 = y1 + height; image = new CairoImage (x1, y1, x2, y2); saveImage (image); if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); setCairo (cr); cairo_translate (cr, 0, height); cairo_scale (cr, width, -height); CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskInvert); image->setImage (surface); setCairo (NULL); cairo_surface_destroy (surface); cairo_destroy (cr); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
710
void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; double *ctm; double mat[6]; CairoImage *image; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; x1 = mat[4]; y1 = mat[5]; x2 = x1 + width; y2 = y1 + height; image = new CairoImage (x1, y1, x2, y2); saveImage (image); if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); setCairo (cr); cairo_translate (cr, 0, height); cairo_scale (cr, width, -height); CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskColorMap); image->setImage (surface); setCairo (NULL); cairo_surface_destroy (surface); cairo_destroy (cr); } }
DoS Exec Code Overflow
0
void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap) { cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; double *ctm; double mat[6]; CairoImage *image; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; x1 = mat[4]; y1 = mat[5]; x2 = x1 + width; y2 = y1 + height; image = new CairoImage (x1, y1, x2, y2); saveImage (image); if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); setCairo (cr); cairo_translate (cr, 0, height); cairo_scale (cr, width, -height); CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskColorMap); image->setImage (surface); setCairo (NULL); cairo_surface_destroy (surface); cairo_destroy (cr); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
711
void CairoOutputDev::endMarkedContent(GfxState *state) { if (text) actualText->endMC(state); }
DoS Exec Code Overflow
0
void CairoOutputDev::endMarkedContent(GfxState *state) { if (text) actualText->endMC(state); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
712
void CairoOutputDev::endPage() { if (text) { text->endPage(); text->coalesce(gTrue, gFalse); } }
DoS Exec Code Overflow
0
void CairoOutputDev::endPage() { if (text) { text->endPage(); text->coalesce(gTrue, gFalse); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
713
void CairoOutputDev::endString(GfxState *state) { int render; if (!currentFont) return; if (!glyphs) return; render = state->getRender(); if (render == 3 || glyphCount == 0) { gfree(glyphs); glyphs = NULL; return; } if (!(render & 1)) { LOG (printf ("fill string\n")); cairo_set_source (cairo, fill_pattern); cairo_show_glyphs (cairo, glyphs, glyphCount); if (cairo_shape) cairo_show_glyphs (cairo_shape, glyphs, glyphCount); } if ((render & 3) == 1 || (render & 3) == 2) { LOG (printf ("stroke string\n")); cairo_set_source (cairo, stroke_pattern); cairo_glyph_path (cairo, glyphs, glyphCount); cairo_stroke (cairo); if (cairo_shape) { cairo_glyph_path (cairo_shape, glyphs, glyphCount); cairo_stroke (cairo_shape); } } if (render & 4) { LOG (printf ("clip string\n")); if (textClipPath) { cairo_append_path (cairo, textClipPath); if (cairo_shape) { cairo_append_path (cairo_shape, textClipPath); } cairo_path_destroy (textClipPath); } cairo_glyph_path (cairo, glyphs, glyphCount); textClipPath = cairo_copy_path (cairo); cairo_new_path (cairo); if (cairo_shape) { cairo_new_path (cairo_shape); } } gfree (glyphs); glyphs = NULL; }
DoS Exec Code Overflow
0
void CairoOutputDev::endString(GfxState *state) { int render; if (!currentFont) return; if (!glyphs) return; render = state->getRender(); if (render == 3 || glyphCount == 0) { gfree(glyphs); glyphs = NULL; return; } if (!(render & 1)) { LOG (printf ("fill string\n")); cairo_set_source (cairo, fill_pattern); cairo_show_glyphs (cairo, glyphs, glyphCount); if (cairo_shape) cairo_show_glyphs (cairo_shape, glyphs, glyphCount); } if ((render & 3) == 1 || (render & 3) == 2) { LOG (printf ("stroke string\n")); cairo_set_source (cairo, stroke_pattern); cairo_glyph_path (cairo, glyphs, glyphCount); cairo_stroke (cairo); if (cairo_shape) { cairo_glyph_path (cairo_shape, glyphs, glyphCount); cairo_stroke (cairo_shape); } } if (render & 4) { LOG (printf ("clip string\n")); if (textClipPath) { cairo_append_path (cairo, textClipPath); if (cairo_shape) { cairo_append_path (cairo_shape, textClipPath); } cairo_path_destroy (textClipPath); } cairo_glyph_path (cairo, glyphs, glyphCount); textClipPath = cairo_copy_path (cairo); cairo_new_path (cairo); if (cairo_shape) { cairo_new_path (cairo_shape); } } gfree (glyphs); glyphs = NULL; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
714
void CairoOutputDev::endTextObject(GfxState *state) { if (textClipPath) { cairo_append_path (cairo, textClipPath); cairo_clip (cairo); if (cairo_shape) { cairo_append_path (cairo_shape, textClipPath); cairo_clip (cairo_shape); } cairo_path_destroy (textClipPath); textClipPath = NULL; } }
DoS Exec Code Overflow
0
void CairoOutputDev::endTextObject(GfxState *state) { if (textClipPath) { cairo_append_path (cairo, textClipPath); cairo_clip (cairo); if (cairo_shape) { cairo_append_path (cairo_shape, textClipPath); cairo_clip (cairo_shape); } cairo_path_destroy (textClipPath); textClipPath = NULL; } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
715
void CairoOutputDev::endType3Char(GfxState *state) { cairo_restore (cairo); if (cairo_shape) { cairo_restore (cairo_shape); } }
DoS Exec Code Overflow
0
void CairoOutputDev::endType3Char(GfxState *state) { cairo_restore (cairo); if (cairo_shape) { cairo_restore (cairo_shape); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
716
void CairoOutputDev::eoFill(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD); cairo_set_source (cairo, fill_pattern); LOG(printf ("fill-eo\n")); cairo_fill (cairo); if (cairo_shape) { cairo_set_fill_rule (cairo_shape, CAIRO_FILL_RULE_EVEN_ODD); doPath (cairo_shape, state, state->getPath()); cairo_fill (cairo_shape); } }
DoS Exec Code Overflow
0
void CairoOutputDev::eoFill(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD); cairo_set_source (cairo, fill_pattern); LOG(printf ("fill-eo\n")); cairo_fill (cairo); if (cairo_shape) { cairo_set_fill_rule (cairo_shape, CAIRO_FILL_RULE_EVEN_ODD); doPath (cairo_shape, state, state->getPath()); cairo_fill (cairo_shape); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
717
void CairoOutputDev::fill(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING); cairo_set_source (cairo, fill_pattern); LOG(printf ("fill\n")); cairo_fill (cairo); if (cairo_shape) { cairo_set_fill_rule (cairo_shape, CAIRO_FILL_RULE_WINDING); doPath (cairo_shape, state, state->getPath()); cairo_fill (cairo_shape); } }
DoS Exec Code Overflow
0
void CairoOutputDev::fill(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING); cairo_set_source (cairo, fill_pattern); LOG(printf ("fill\n")); cairo_fill (cairo); if (cairo_shape) { cairo_set_fill_rule (cairo_shape, CAIRO_FILL_RULE_WINDING); doPath (cairo_shape, state, state->getPath()); cairo_fill (cairo_shape); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
718
static uint32_t luminocity(uint32_t x) { int r = (x >> 16) & 0xff; int g = (x >> 8) & 0xff; int b = (x >> 0) & 0xff; int y = (r*19661+g*38666+b*7209 + 32829)>>16; return y << 24; }
DoS Exec Code Overflow
0
static uint32_t luminocity(uint32_t x) { int r = (x >> 16) & 0xff; int g = (x >> 8) & 0xff; int b = (x >> 0) & 0xff; int y = (r*19661+g*38666+b*7209 + 32829)>>16; return y << 24; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
719
void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) { cairo_set_source (cairo, group); if (!mask) { if (shape) { cairo_save (cairo); /* OPERATOR_SOURCE w/ a mask is defined as (src IN mask) ADD (dest OUT mask) * however our source has already been clipped to mask so we only need to * do ADD and OUT */ /* clear the shape mask */ cairo_set_source (cairo, shape); cairo_set_operator (cairo, CAIRO_OPERATOR_DEST_OUT); cairo_paint (cairo); cairo_set_operator (cairo, CAIRO_OPERATOR_ADD); cairo_set_source (cairo, group); cairo_paint (cairo); cairo_restore (cairo); cairo_pattern_destroy (shape); shape = NULL; } else { cairo_paint_with_alpha (cairo, fill_opacity); } cairo_status_t status = cairo_status(cairo); if (status) printf("BAD status: %s\n", cairo_status_to_string(status)); } else { cairo_mask(cairo, mask); cairo_pattern_destroy(mask); mask = NULL; } popTransparencyGroup(); }
DoS Exec Code Overflow
0
void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) { cairo_set_source (cairo, group); if (!mask) { if (shape) { cairo_save (cairo); /* OPERATOR_SOURCE w/ a mask is defined as (src IN mask) ADD (dest OUT mask) * however our source has already been clipped to mask so we only need to * do ADD and OUT */ /* clear the shape mask */ cairo_set_source (cairo, shape); cairo_set_operator (cairo, CAIRO_OPERATOR_DEST_OUT); cairo_paint (cairo); cairo_set_operator (cairo, CAIRO_OPERATOR_ADD); cairo_set_source (cairo, group); cairo_paint (cairo); cairo_restore (cairo); cairo_pattern_destroy (shape); shape = NULL; } else { cairo_paint_with_alpha (cairo, fill_opacity); } cairo_status_t status = cairo_status(cairo); if (status) printf("BAD status: %s\n", cairo_status_to_string(status)); } else { cairo_mask(cairo, mask); cairo_pattern_destroy(mask); mask = NULL; } popTransparencyGroup(); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
720
void CairoImageOutputDev::saveImage(CairoImage *image) { if (numImages >= size) { size += 16; images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *)); } images[numImages++] = image; }
DoS Exec Code Overflow
0
void CairoImageOutputDev::saveImage(CairoImage *image) { if (numImages >= size) { size += 16; images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *)); } images[numImages++] = image; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
721
void CairoOutputDev::saveState(GfxState *state) { LOG(printf ("save\n")); cairo_save (cairo); if (cairo_shape) cairo_save (cairo_shape); MaskStack *ms = new MaskStack; ms->mask = cairo_pattern_reference(mask); ms->next = maskStack; maskStack = ms; }
DoS Exec Code Overflow
0
void CairoOutputDev::saveState(GfxState *state) { LOG(printf ("save\n")); cairo_save (cairo); if (cairo_shape) cairo_save (cairo_shape); MaskStack *ms = new MaskStack; ms->mask = cairo_pattern_reference(mask); ms->next = maskStack; maskStack = ms; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
722
void CairoOutputDev::setCairo(cairo_t *cairo) { if (this->cairo != NULL) { cairo_status_t status = cairo_status (this->cairo); if (status) { warning("cairo context error: %s\n", cairo_status_to_string(status)); } cairo_destroy (this->cairo); assert(!cairo_shape); } if (cairo != NULL) { this->cairo = cairo_reference (cairo); /* save the initial matrix so that we can use it for type3 fonts. */ cairo_get_matrix(cairo, &orig_matrix); } else { this->cairo = NULL; this->cairo_shape = NULL; } }
DoS Exec Code Overflow
0
void CairoOutputDev::setCairo(cairo_t *cairo) { if (this->cairo != NULL) { cairo_status_t status = cairo_status (this->cairo); if (status) { warning("cairo context error: %s\n", cairo_status_to_string(status)); } cairo_destroy (this->cairo); assert(!cairo_shape); } if (cairo != NULL) { this->cairo = cairo_reference (cairo); /* save the initial matrix so that we can use it for type3 fonts. */ cairo_get_matrix(cairo, &orig_matrix); } else { this->cairo = NULL; this->cairo_shape = NULL; } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
723
void CairoOutputDev::setDefaultCTM(double *ctm) { cairo_matrix_t matrix; matrix.xx = ctm[0]; matrix.yx = ctm[1]; matrix.xy = ctm[2]; matrix.yy = ctm[3]; matrix.x0 = ctm[4]; matrix.y0 = ctm[5]; cairo_transform (cairo, &matrix); if (cairo_shape) cairo_transform (cairo_shape, &matrix); OutputDev::setDefaultCTM(ctm); }
DoS Exec Code Overflow
0
void CairoOutputDev::setDefaultCTM(double *ctm) { cairo_matrix_t matrix; matrix.xx = ctm[0]; matrix.yx = ctm[1]; matrix.xy = ctm[2]; matrix.yy = ctm[3]; matrix.x0 = ctm[4]; matrix.y0 = ctm[5]; cairo_transform (cairo, &matrix); if (cairo_shape) cairo_transform (cairo_shape, &matrix); OutputDev::setDefaultCTM(ctm); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
724
void CairoImage::setImage (cairo_surface_t *image) { if (this->image) cairo_surface_destroy (this->image); this->image = cairo_surface_reference (image); }
DoS Exec Code Overflow
0
void CairoImage::setImage (cairo_surface_t *image) { if (this->image) cairo_surface_destroy (this->image); this->image = cairo_surface_reference (image); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
725
static inline int splashFloor(SplashCoord x) { return (int)floor(x); }
DoS Exec Code Overflow
0
static inline int splashFloor(SplashCoord x) { return (int)floor(x); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
726
static inline int splashRound(SplashCoord x) { return (int)floor(x + 0.5); }
DoS Exec Code Overflow
0
static inline int splashRound(SplashCoord x) { return (int)floor(x + 0.5); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
727
void CairoOutputDev::startDoc(XRef *xrefA, Catalog *catalogA, CairoFontEngine *parentFontEngine) { xref = xrefA; catalog = catalogA; if (parentFontEngine) { fontEngine = parentFontEngine; } else { if (fontEngine) { delete fontEngine; } fontEngine = new CairoFontEngine(ft_lib); fontEngine_owner = gTrue; } }
DoS Exec Code Overflow
0
void CairoOutputDev::startDoc(XRef *xrefA, Catalog *catalogA, CairoFontEngine *parentFontEngine) { xref = xrefA; catalog = catalogA; if (parentFontEngine) { fontEngine = parentFontEngine; } else { if (fontEngine) { delete fontEngine; } fontEngine = new CairoFontEngine(ft_lib); fontEngine_owner = gTrue; } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
728
void CairoOutputDev::startPage(int pageNum, GfxState *state) { /* set up some per page defaults */ cairo_pattern_destroy(fill_pattern); fill_pattern = cairo_pattern_create_rgb(0., 0., 0.); cairo_pattern_destroy(stroke_pattern); stroke_pattern = cairo_pattern_create_rgb(0., 0., 0.); if (text) text->startPage(state); }
DoS Exec Code Overflow
0
void CairoOutputDev::startPage(int pageNum, GfxState *state) { /* set up some per page defaults */ cairo_pattern_destroy(fill_pattern); fill_pattern = cairo_pattern_create_rgb(0., 0., 0.); cairo_pattern_destroy(stroke_pattern); stroke_pattern = cairo_pattern_create_rgb(0., 0., 0.); if (text) text->startPage(state); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
729
void CairoOutputDev::stroke(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_source (cairo, stroke_pattern); LOG(printf ("stroke\n")); cairo_stroke (cairo); if (cairo_shape) { doPath (cairo_shape, state, state->getPath()); cairo_stroke (cairo_shape); } }
DoS Exec Code Overflow
0
void CairoOutputDev::stroke(GfxState *state) { doPath (cairo, state, state->getPath()); cairo_set_source (cairo, stroke_pattern); LOG(printf ("stroke\n")); cairo_stroke (cairo); if (cairo_shape) { doPath (cairo_shape, state, state->getPath()); cairo_stroke (cairo_shape); } }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
730
void CairoOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) { t3_glyph_wx = wx; t3_glyph_wy = wy; t3_glyph_bbox[0] = llx; t3_glyph_bbox[1] = lly; t3_glyph_bbox[2] = urx; t3_glyph_bbox[3] = ury; t3_glyph_has_bbox = gTrue; }
DoS Exec Code Overflow
0
void CairoOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) { t3_glyph_wx = wx; t3_glyph_wy = wy; t3_glyph_bbox[0] = llx; t3_glyph_bbox[1] = lly; t3_glyph_bbox[2] = urx; t3_glyph_bbox[3] = ury; t3_glyph_has_bbox = gTrue; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
731
void CairoOutputDev::updateAll(GfxState *state) { updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateLineWidth(state); updateFlatness(state); updateMiterLimit(state); updateFillColor(state); updateStrokeColor(state); updateFillOpacity(state); updateStrokeOpacity(state); needFontUpdate = gTrue; }
DoS Exec Code Overflow
0
void CairoOutputDev::updateAll(GfxState *state) { updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateLineWidth(state); updateFlatness(state); updateMiterLimit(state); updateFillColor(state); updateStrokeColor(state); updateFillOpacity(state); updateStrokeOpacity(state); needFontUpdate = gTrue; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
732
void CairoOutputDev::updateFillColor(GfxState *state) { state->getFillRGB(&fill_color); cairo_pattern_destroy(fill_pattern); fill_pattern = cairo_pattern_create_rgba(fill_color.r / 65535.0, fill_color.g / 65535.0, fill_color.b / 65535.0, fill_opacity); LOG(printf ("fill color: %d %d %d\n", fill_color.r, fill_color.g, fill_color.b)); }
DoS Exec Code Overflow
0
void CairoOutputDev::updateFillColor(GfxState *state) { state->getFillRGB(&fill_color); cairo_pattern_destroy(fill_pattern); fill_pattern = cairo_pattern_create_rgba(fill_color.r / 65535.0, fill_color.g / 65535.0, fill_color.b / 65535.0, fill_opacity); LOG(printf ("fill color: %d %d %d\n", fill_color.r, fill_color.g, fill_color.b)); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
733
void CairoOutputDev::updateFlatness(GfxState *state) { }
DoS Exec Code Overflow
0
void CairoOutputDev::updateFlatness(GfxState *state) { }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
734
void CairoOutputDev::updateLineCap(GfxState *state) { switch (state->getLineCap()) { case 0: cairo_set_line_cap (cairo, CAIRO_LINE_CAP_BUTT); break; case 1: cairo_set_line_cap (cairo, CAIRO_LINE_CAP_ROUND); break; case 2: cairo_set_line_cap (cairo, CAIRO_LINE_CAP_SQUARE); break; } if (cairo_shape) cairo_set_line_cap (cairo_shape, cairo_get_line_cap(cairo)); }
DoS Exec Code Overflow
0
void CairoOutputDev::updateLineCap(GfxState *state) { switch (state->getLineCap()) { case 0: cairo_set_line_cap (cairo, CAIRO_LINE_CAP_BUTT); break; case 1: cairo_set_line_cap (cairo, CAIRO_LINE_CAP_ROUND); break; case 2: cairo_set_line_cap (cairo, CAIRO_LINE_CAP_SQUARE); break; } if (cairo_shape) cairo_set_line_cap (cairo_shape, cairo_get_line_cap(cairo)); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
735
void CairoOutputDev::updateLineDash(GfxState *state) { double *dashPattern; int dashLength; double dashStart; state->getLineDash(&dashPattern, &dashLength, &dashStart); cairo_set_dash (cairo, dashPattern, dashLength, dashStart); if (cairo_shape) cairo_set_dash (cairo_shape, dashPattern, dashLength, dashStart); }
DoS Exec Code Overflow
0
void CairoOutputDev::updateLineDash(GfxState *state) { double *dashPattern; int dashLength; double dashStart; state->getLineDash(&dashPattern, &dashLength, &dashStart); cairo_set_dash (cairo, dashPattern, dashLength, dashStart); if (cairo_shape) cairo_set_dash (cairo_shape, dashPattern, dashLength, dashStart); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
736
void CairoOutputDev::updateLineJoin(GfxState *state) { switch (state->getLineJoin()) { case 0: cairo_set_line_join (cairo, CAIRO_LINE_JOIN_MITER); break; case 1: cairo_set_line_join (cairo, CAIRO_LINE_JOIN_ROUND); break; case 2: cairo_set_line_join (cairo, CAIRO_LINE_JOIN_BEVEL); break; } if (cairo_shape) cairo_set_line_join (cairo_shape, cairo_get_line_join(cairo)); }
DoS Exec Code Overflow
0
void CairoOutputDev::updateLineJoin(GfxState *state) { switch (state->getLineJoin()) { case 0: cairo_set_line_join (cairo, CAIRO_LINE_JOIN_MITER); break; case 1: cairo_set_line_join (cairo, CAIRO_LINE_JOIN_ROUND); break; case 2: cairo_set_line_join (cairo, CAIRO_LINE_JOIN_BEVEL); break; } if (cairo_shape) cairo_set_line_join (cairo_shape, cairo_get_line_join(cairo)); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
737
void CairoOutputDev::updateMiterLimit(GfxState *state) { cairo_set_miter_limit (cairo, state->getMiterLimit()); if (cairo_shape) cairo_set_miter_limit (cairo_shape, state->getMiterLimit()); }
DoS Exec Code Overflow
0
void CairoOutputDev::updateMiterLimit(GfxState *state) { cairo_set_miter_limit (cairo, state->getMiterLimit()); if (cairo_shape) cairo_set_miter_limit (cairo_shape, state->getMiterLimit()); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
738
void CairoOutputDev::updateStrokeColor(GfxState *state) { state->getStrokeRGB(&stroke_color); cairo_pattern_destroy(stroke_pattern); stroke_pattern = cairo_pattern_create_rgba(stroke_color.r / 65535.0, stroke_color.g / 65535.0, stroke_color.b / 65535.0, stroke_opacity); LOG(printf ("stroke color: %d %d %d\n", stroke_color.r, stroke_color.g, stroke_color.b)); }
DoS Exec Code Overflow
0
void CairoOutputDev::updateStrokeColor(GfxState *state) { state->getStrokeRGB(&stroke_color); cairo_pattern_destroy(stroke_pattern); stroke_pattern = cairo_pattern_create_rgba(stroke_color.r / 65535.0, stroke_color.g / 65535.0, stroke_color.b / 65535.0, stroke_opacity); LOG(printf ("stroke color: %d %d %d\n", stroke_color.r, stroke_color.g, stroke_color.b)); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
739
CairoImage::~CairoImage () { if (image) cairo_surface_destroy (image); }
DoS Exec Code Overflow
0
CairoImage::~CairoImage () { if (image) cairo_surface_destroy (image); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
740
CairoImageOutputDev::~CairoImageOutputDev() { int i; for (i = 0; i < numImages; i++) delete images[i]; gfree (images); }
DoS Exec Code Overflow
0
CairoImageOutputDev::~CairoImageOutputDev() { int i; for (i = 0; i < numImages; i++) delete images[i]; gfree (images); }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
741
CairoOutputDev::~CairoOutputDev() { if (fontEngine_owner && fontEngine) { delete fontEngine; } if (cairo) cairo_destroy (cairo); cairo_pattern_destroy (stroke_pattern); cairo_pattern_destroy (fill_pattern); if (group) cairo_pattern_destroy (group); if (mask) cairo_pattern_destroy (mask); if (shape) cairo_pattern_destroy (shape); if (text) text->decRefCnt(); if (actualText) delete actualText; }
DoS Exec Code Overflow
0
CairoOutputDev::~CairoOutputDev() { if (fontEngine_owner && fontEngine) { delete fontEngine; } if (cairo) cairo_destroy (cairo); cairo_pattern_destroy (stroke_pattern); cairo_pattern_destroy (fill_pattern); if (group) cairo_pattern_destroy (group); if (mask) cairo_pattern_destroy (mask); if (shape) cairo_pattern_destroy (shape); if (text) text->decRefCnt(); if (actualText) delete actualText; }
@@ -16,7 +16,7 @@ // // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> -// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2008 Carl Worth <cworth@cworth.org> @@ -611,7 +611,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s) if (!currentFont) return; - glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t)); + glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t)); glyphCount = 0; } @@ -1461,7 +1461,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1497,7 +1497,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1586,7 +1586,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s int row_stride = (maskWidth + 3) & ~3; unsigned char *maskBuffer; - maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight); + maskBuffer = (unsigned char *)gmallocn (row_stride, maskHeight); unsigned char *maskDest; cairo_surface_t *maskImage; cairo_pattern_t *maskPattern; @@ -1613,7 +1613,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_matrix_t maskMatrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width, @@ -1705,7 +1705,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_matrix_t matrix; int is_identity_transform; - buffer = (unsigned char *)gmalloc (width * height * 4); + buffer = (unsigned char *)gmallocn3 (width, height, 4); /* TODO: Do we want to cache these? */ imgStr = new ImageStream(str, width,
CWE-189
null
null
742
static int CMSError(int ecode, const char *msg) { error(-1,const_cast<char *>(msg)); return 1; }
DoS Exec Code Overflow
0
static int CMSError(int ecode, const char *msg) { error(-1,const_cast<char *>(msg)); return 1; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
743
GfxAxialShading::GfxAxialShading(double x0A, double y0A, double x1A, double y1A, double t0A, double t1A, Function **funcsA, int nFuncsA, GBool extend0A, GBool extend1A): GfxShading(2) { int i; x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; t0 = t0A; t1 = t1A; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } extend0 = extend0A; extend1 = extend1A; }
DoS Exec Code Overflow
0
GfxAxialShading::GfxAxialShading(double x0A, double y0A, double x1A, double y1A, double t0A, double t1A, Function **funcsA, int nFuncsA, GBool extend0A, GBool extend1A): GfxShading(2) { int i; x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; t0 = t0A; t1 = t1A; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } extend0 = extend0A; extend1 = extend1A; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
744
GfxCalGrayColorSpace::GfxCalGrayColorSpace() { whiteX = whiteY = whiteZ = 1; blackX = blackY = blackZ = 0; gamma = 1; }
DoS Exec Code Overflow
0
GfxCalGrayColorSpace::GfxCalGrayColorSpace() { whiteX = whiteY = whiteZ = 1; blackX = blackY = blackZ = 0; gamma = 1; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
745
GfxCalRGBColorSpace::GfxCalRGBColorSpace() { whiteX = whiteY = whiteZ = 1; blackX = blackY = blackZ = 0; gammaR = gammaG = gammaB = 1; mat[0] = 1; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = 1; mat[5] = 0; mat[6] = 0; mat[7] = 0; mat[8] = 1; }
DoS Exec Code Overflow
0
GfxCalRGBColorSpace::GfxCalRGBColorSpace() { whiteX = whiteY = whiteZ = 1; blackX = blackY = blackZ = 0; gammaR = gammaG = gammaB = 1; mat[0] = 1; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = 1; mat[5] = 0; mat[6] = 0; mat[7] = 0; mat[8] = 1; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
746
GfxColorSpace::GfxColorSpace() { }
DoS Exec Code Overflow
0
GfxColorSpace::GfxColorSpace() { }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
747
GfxDeviceCMYKColorSpace::GfxDeviceCMYKColorSpace() { }
DoS Exec Code Overflow
0
GfxDeviceCMYKColorSpace::GfxDeviceCMYKColorSpace() { }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
748
GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() { }
DoS Exec Code Overflow
0
GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() { }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
749
GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA, GfxColorSpace *altA, Function *funcA) { nComps = nCompsA; alt = altA; func = funcA; nonMarking = gFalse; }
DoS Exec Code Overflow
0
GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA, GfxColorSpace *altA, Function *funcA) { nComps = nCompsA; alt = altA; func = funcA; nonMarking = gFalse; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
750
GfxDeviceRGBColorSpace::GfxDeviceRGBColorSpace() { }
DoS Exec Code Overflow
0
GfxDeviceRGBColorSpace::GfxDeviceRGBColorSpace() { }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
751
GfxFunctionShading::GfxFunctionShading(double x0A, double y0A, double x1A, double y1A, double *matrixA, Function **funcsA, int nFuncsA): GfxShading(1) { int i; x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; for (i = 0; i < 6; ++i) { matrix[i] = matrixA[i]; } nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
DoS Exec Code Overflow
0
GfxFunctionShading::GfxFunctionShading(double x0A, double y0A, double x1A, double y1A, double *matrixA, Function **funcsA, int nFuncsA): GfxShading(1) { int i; x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; for (i = 0; i < 6; ++i) { matrix[i] = matrixA[i]; } nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
752
GfxFunctionShading::GfxFunctionShading(GfxFunctionShading *shading): GfxShading(shading) { int i; x0 = shading->x0; y0 = shading->y0; x1 = shading->x1; y1 = shading->y1; for (i = 0; i < 6; ++i) { matrix[i] = shading->matrix[i]; } nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } }
DoS Exec Code Overflow
0
GfxFunctionShading::GfxFunctionShading(GfxFunctionShading *shading): GfxShading(shading) { int i; x0 = shading->x0; y0 = shading->y0; x1 = shading->x1; y1 = shading->y1; for (i = 0; i < 6; ++i) { matrix[i] = shading->matrix[i]; } nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
753
GfxGouraudTriangleShading::GfxGouraudTriangleShading( int typeA, GfxGouraudVertex *verticesA, int nVerticesA, int (*trianglesA)[3], int nTrianglesA, Function **funcsA, int nFuncsA): GfxShading(typeA) { int i; vertices = verticesA; nVertices = nVerticesA; triangles = trianglesA; nTriangles = nTrianglesA; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
DoS Exec Code Overflow
0
GfxGouraudTriangleShading::GfxGouraudTriangleShading( int typeA, GfxGouraudVertex *verticesA, int nVerticesA, int (*trianglesA)[3], int nTrianglesA, Function **funcsA, int nFuncsA): GfxShading(typeA) { int i; vertices = verticesA; nVertices = nVerticesA; triangles = trianglesA; nTriangles = nTrianglesA; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
754
GfxGouraudTriangleShading::GfxGouraudTriangleShading( GfxGouraudTriangleShading *shading): GfxShading(shading) { int i; nVertices = shading->nVertices; vertices = (GfxGouraudVertex *)gmallocn(nVertices, sizeof(GfxGouraudVertex)); memcpy(vertices, shading->vertices, nVertices * sizeof(GfxGouraudVertex)); nTriangles = shading->nTriangles; triangles = (int (*)[3])gmallocn(nTriangles * 3, sizeof(int)); memcpy(triangles, shading->triangles, nTriangles * 3 * sizeof(int)); nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } }
DoS Exec Code Overflow
0
GfxGouraudTriangleShading::GfxGouraudTriangleShading( GfxGouraudTriangleShading *shading): GfxShading(shading) { int i; nVertices = shading->nVertices; vertices = (GfxGouraudVertex *)gmallocn(nVertices, sizeof(GfxGouraudVertex)); memcpy(vertices, shading->vertices, nVertices * sizeof(GfxGouraudVertex)); nTriangles = shading->nTriangles; triangles = (int (*)[3])gmallocn(nTriangles * 3, sizeof(int)); memcpy(triangles, shading->triangles, nTriangles * 3 * sizeof(int)); nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
755
GfxICCBasedCache::GfxICCBasedCache() { num = 0; gen = 0; colorSpace = 0; }
DoS Exec Code Overflow
0
GfxICCBasedCache::GfxICCBasedCache() { num = 0; gen = 0; colorSpace = 0; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
756
GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA, Ref *iccProfileStreamA) { nComps = nCompsA; alt = altA; iccProfileStream = *iccProfileStreamA; rangeMin[0] = rangeMin[1] = rangeMin[2] = rangeMin[3] = 0; rangeMax[0] = rangeMax[1] = rangeMax[2] = rangeMax[3] = 1; #ifdef USE_CMS transform = NULL; lineTransform = NULL; #endif }
DoS Exec Code Overflow
0
GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA, Ref *iccProfileStreamA) { nComps = nCompsA; alt = altA; iccProfileStream = *iccProfileStreamA; rangeMin[0] = rangeMin[1] = rangeMin[2] = rangeMin[3] = 0; rangeMax[0] = rangeMax[1] = rangeMax[2] = rangeMax[3] = 1; #ifdef USE_CMS transform = NULL; lineTransform = NULL; #endif }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
757
GfxIndexedColorSpace::GfxIndexedColorSpace(GfxColorSpace *baseA, int indexHighA) { base = baseA; indexHigh = indexHighA; lookup = (Guchar *)gmallocn((indexHigh + 1) * base->getNComps(), sizeof(Guchar)); }
DoS Exec Code Overflow
0
GfxIndexedColorSpace::GfxIndexedColorSpace(GfxColorSpace *baseA, int indexHighA) { base = baseA; indexHigh = indexHighA; lookup = (Guchar *)gmallocn((indexHigh + 1) * base->getNComps(), sizeof(Guchar)); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
758
GfxLabColorSpace::GfxLabColorSpace() { whiteX = whiteY = whiteZ = 1; blackX = blackY = blackZ = 0; aMin = bMin = -100; aMax = bMax = 100; }
DoS Exec Code Overflow
0
GfxLabColorSpace::GfxLabColorSpace() { whiteX = whiteY = whiteZ = 1; blackX = blackY = blackZ = 0; aMin = bMin = -100; aMax = bMax = 100; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
759
GfxPatchMeshShading::GfxPatchMeshShading(int typeA, GfxPatch *patchesA, int nPatchesA, Function **funcsA, int nFuncsA): GfxShading(typeA) { int i; patches = patchesA; nPatches = nPatchesA; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
DoS Exec Code Overflow
0
GfxPatchMeshShading::GfxPatchMeshShading(int typeA, GfxPatch *patchesA, int nPatchesA, Function **funcsA, int nFuncsA): GfxShading(typeA) { int i; patches = patchesA; nPatches = nPatchesA; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
760
GfxPatchMeshShading::GfxPatchMeshShading(GfxPatchMeshShading *shading): GfxShading(shading) { int i; nPatches = shading->nPatches; patches = (GfxPatch *)gmallocn(nPatches, sizeof(GfxPatch)); memcpy(patches, shading->patches, nPatches * sizeof(GfxPatch)); nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } }
DoS Exec Code Overflow
0
GfxPatchMeshShading::GfxPatchMeshShading(GfxPatchMeshShading *shading): GfxShading(shading) { int i; nPatches = shading->nPatches; patches = (GfxPatch *)gmallocn(nPatches, sizeof(GfxPatch)); memcpy(patches, shading->patches, nPatches * sizeof(GfxPatch)); nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
761
GfxPath::GfxPath() { justMoved = gFalse; size = 16; n = 0; firstX = firstY = 0; subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *)); }
DoS Exec Code Overflow
0
GfxPath::GfxPath() { justMoved = gFalse; size = 16; n = 0; firstX = firstY = 0; subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *)); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
762
GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1, GfxSubpath **subpaths1, int n1, int size1) { int i; justMoved = justMoved1; firstX = firstX1; firstY = firstY1; size = size1; n = n1; subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *)); for (i = 0; i < n; ++i) subpaths[i] = subpaths1[i]->copy(); }
DoS Exec Code Overflow
0
GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1, GfxSubpath **subpaths1, int n1, int size1) { int i; justMoved = justMoved1; firstX = firstX1; firstY = firstY1; size = size1; n = n1; subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *)); for (i = 0; i < n; ++i) subpaths[i] = subpaths1[i]->copy(); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
763
GfxPattern::GfxPattern(int typeA) { type = typeA; }
DoS Exec Code Overflow
0
GfxPattern::GfxPattern(int typeA) { type = typeA; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
764
GfxPatternColorSpace::GfxPatternColorSpace(GfxColorSpace *underA) { under = underA; }
DoS Exec Code Overflow
0
GfxPatternColorSpace::GfxPatternColorSpace(GfxColorSpace *underA) { under = underA; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
765
GfxRadialShading::GfxRadialShading(double x0A, double y0A, double r0A, double x1A, double y1A, double r1A, double t0A, double t1A, Function **funcsA, int nFuncsA, GBool extend0A, GBool extend1A): GfxShading(3) { int i; x0 = x0A; y0 = y0A; r0 = r0A; x1 = x1A; y1 = y1A; r1 = r1A; t0 = t0A; t1 = t1A; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } extend0 = extend0A; extend1 = extend1A; }
DoS Exec Code Overflow
0
GfxRadialShading::GfxRadialShading(double x0A, double y0A, double r0A, double x1A, double y1A, double r1A, double t0A, double t1A, Function **funcsA, int nFuncsA, GBool extend0A, GBool extend1A): GfxShading(3) { int i; x0 = x0A; y0 = y0A; r0 = r0A; x1 = x1A; y1 = y1A; r1 = r1A; t0 = t0A; t1 = t1A; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } extend0 = extend0A; extend1 = extend1A; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
766
GfxRadialShading::GfxRadialShading(GfxRadialShading *shading): GfxShading(shading) { int i; x0 = shading->x0; y0 = shading->y0; r0 = shading->r0; x1 = shading->x1; y1 = shading->y1; r1 = shading->r1; t0 = shading->t0; y1 = shading->t1; nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } extend0 = shading->extend0; extend1 = shading->extend1; }
DoS Exec Code Overflow
0
GfxRadialShading::GfxRadialShading(GfxRadialShading *shading): GfxShading(shading) { int i; x0 = shading->x0; y0 = shading->y0; r0 = shading->r0; x1 = shading->x1; y1 = shading->y1; r1 = shading->r1; t0 = shading->t0; y1 = shading->t1; nFuncs = shading->nFuncs; for (i = 0; i < nFuncs; ++i) { funcs[i] = shading->funcs[i]->copy(); } extend0 = shading->extend0; extend1 = shading->extend1; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
767
GfxSeparationColorSpace::GfxSeparationColorSpace(GooString *nameA, GfxColorSpace *altA, Function *funcA) { name = nameA; alt = altA; func = funcA; nonMarking = !name->cmp("None"); }
DoS Exec Code Overflow
0
GfxSeparationColorSpace::GfxSeparationColorSpace(GooString *nameA, GfxColorSpace *altA, Function *funcA) { name = nameA; alt = altA; func = funcA; nonMarking = !name->cmp("None"); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
768
GfxShading::GfxShading(int typeA) { type = typeA; colorSpace = NULL; }
DoS Exec Code Overflow
0
GfxShading::GfxShading(int typeA) { type = typeA; colorSpace = NULL; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
769
GfxShading::GfxShading(GfxShading *shading) { int i; type = shading->type; colorSpace = shading->colorSpace->copy(); for (i = 0; i < gfxColorMaxComps; ++i) { background.c[i] = shading->background.c[i]; } hasBackground = shading->hasBackground; xMin = shading->xMin; yMin = shading->yMin; xMax = shading->xMax; yMax = shading->yMax; hasBBox = shading->hasBBox; }
DoS Exec Code Overflow
0
GfxShading::GfxShading(GfxShading *shading) { int i; type = shading->type; colorSpace = shading->colorSpace->copy(); for (i = 0; i < gfxColorMaxComps; ++i) { background.c[i] = shading->background.c[i]; } hasBackground = shading->hasBackground; xMin = shading->xMin; yMin = shading->yMin; xMax = shading->xMax; yMax = shading->yMax; hasBBox = shading->hasBBox; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
770
GfxShadingBitBuf::GfxShadingBitBuf(Stream *strA) { str = strA; str->reset(); bitBuf = 0; nBits = 0; }
DoS Exec Code Overflow
0
GfxShadingBitBuf::GfxShadingBitBuf(Stream *strA) { str = strA; str->reset(); bitBuf = 0; nBits = 0; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
771
GfxState::GfxState(double hDPIA, double vDPIA, PDFRectangle *pageBox, int rotateA, GBool upsideDown) { double kx, ky; hDPI = hDPIA; vDPI = vDPIA; rotate = rotateA; px1 = pageBox->x1; py1 = pageBox->y1; px2 = pageBox->x2; py2 = pageBox->y2; kx = hDPI / 72.0; ky = vDPI / 72.0; if (rotate == 90) { ctm[0] = 0; ctm[1] = upsideDown ? ky : -ky; ctm[2] = kx; ctm[3] = 0; ctm[4] = -kx * py1; ctm[5] = ky * (upsideDown ? -px1 : px2); pageWidth = kx * (py2 - py1); pageHeight = ky * (px2 - px1); } else if (rotate == 180) { ctm[0] = -kx; ctm[1] = 0; ctm[2] = 0; ctm[3] = upsideDown ? ky : -ky; ctm[4] = kx * px2; ctm[5] = ky * (upsideDown ? -py1 : py2); pageWidth = kx * (px2 - px1); pageHeight = ky * (py2 - py1); } else if (rotate == 270) { ctm[0] = 0; ctm[1] = upsideDown ? -ky : ky; ctm[2] = -kx; ctm[3] = 0; ctm[4] = kx * py2; ctm[5] = ky * (upsideDown ? px2 : -px1); pageWidth = kx * (py2 - py1); pageHeight = ky * (px2 - px1); } else { ctm[0] = kx; ctm[1] = 0; ctm[2] = 0; ctm[3] = upsideDown ? -ky : ky; ctm[4] = -kx * px1; ctm[5] = ky * (upsideDown ? py2 : -py1); pageWidth = kx * (px2 - px1); pageHeight = ky * (py2 - py1); } fillColorSpace = new GfxDeviceGrayColorSpace(); strokeColorSpace = new GfxDeviceGrayColorSpace(); fillColor.c[0] = 0; strokeColor.c[0] = 0; fillPattern = NULL; strokePattern = NULL; blendMode = gfxBlendNormal; fillOpacity = 1; strokeOpacity = 1; fillOverprint = gFalse; strokeOverprint = gFalse; transfer[0] = transfer[1] = transfer[2] = transfer[3] = NULL; lineWidth = 1; lineDash = NULL; lineDashLength = 0; lineDashStart = 0; flatness = 1; lineJoin = 0; lineCap = 0; miterLimit = 10; strokeAdjust = gFalse; font = NULL; fontSize = 0; textMat[0] = 1; textMat[1] = 0; textMat[2] = 0; textMat[3] = 1; textMat[4] = 0; textMat[5] = 0; charSpace = 0; wordSpace = 0; horizScaling = 1; leading = 0; rise = 0; render = 0; path = new GfxPath(); curX = curY = 0; lineX = lineY = 0; clipXMin = 0; clipYMin = 0; clipXMax = pageWidth; clipYMax = pageHeight; saved = NULL; #ifdef USE_CMS GfxColorSpace::setupColorProfiles(); #endif }
DoS Exec Code Overflow
0
GfxState::GfxState(double hDPIA, double vDPIA, PDFRectangle *pageBox, int rotateA, GBool upsideDown) { double kx, ky; hDPI = hDPIA; vDPI = vDPIA; rotate = rotateA; px1 = pageBox->x1; py1 = pageBox->y1; px2 = pageBox->x2; py2 = pageBox->y2; kx = hDPI / 72.0; ky = vDPI / 72.0; if (rotate == 90) { ctm[0] = 0; ctm[1] = upsideDown ? ky : -ky; ctm[2] = kx; ctm[3] = 0; ctm[4] = -kx * py1; ctm[5] = ky * (upsideDown ? -px1 : px2); pageWidth = kx * (py2 - py1); pageHeight = ky * (px2 - px1); } else if (rotate == 180) { ctm[0] = -kx; ctm[1] = 0; ctm[2] = 0; ctm[3] = upsideDown ? ky : -ky; ctm[4] = kx * px2; ctm[5] = ky * (upsideDown ? -py1 : py2); pageWidth = kx * (px2 - px1); pageHeight = ky * (py2 - py1); } else if (rotate == 270) { ctm[0] = 0; ctm[1] = upsideDown ? -ky : ky; ctm[2] = -kx; ctm[3] = 0; ctm[4] = kx * py2; ctm[5] = ky * (upsideDown ? px2 : -px1); pageWidth = kx * (py2 - py1); pageHeight = ky * (px2 - px1); } else { ctm[0] = kx; ctm[1] = 0; ctm[2] = 0; ctm[3] = upsideDown ? -ky : ky; ctm[4] = -kx * px1; ctm[5] = ky * (upsideDown ? py2 : -py1); pageWidth = kx * (px2 - px1); pageHeight = ky * (py2 - py1); } fillColorSpace = new GfxDeviceGrayColorSpace(); strokeColorSpace = new GfxDeviceGrayColorSpace(); fillColor.c[0] = 0; strokeColor.c[0] = 0; fillPattern = NULL; strokePattern = NULL; blendMode = gfxBlendNormal; fillOpacity = 1; strokeOpacity = 1; fillOverprint = gFalse; strokeOverprint = gFalse; transfer[0] = transfer[1] = transfer[2] = transfer[3] = NULL; lineWidth = 1; lineDash = NULL; lineDashLength = 0; lineDashStart = 0; flatness = 1; lineJoin = 0; lineCap = 0; miterLimit = 10; strokeAdjust = gFalse; font = NULL; fontSize = 0; textMat[0] = 1; textMat[1] = 0; textMat[2] = 0; textMat[3] = 1; textMat[4] = 0; textMat[5] = 0; charSpace = 0; wordSpace = 0; horizScaling = 1; leading = 0; rise = 0; render = 0; path = new GfxPath(); curX = curY = 0; lineX = lineY = 0; clipXMin = 0; clipYMin = 0; clipXMax = pageWidth; clipYMax = pageHeight; saved = NULL; #ifdef USE_CMS GfxColorSpace::setupColorProfiles(); #endif }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
772
GfxState::GfxState(GfxState *state) { int i; memcpy(this, state, sizeof(GfxState)); if (fillColorSpace) { fillColorSpace = state->fillColorSpace->copy(); } if (strokeColorSpace) { strokeColorSpace = state->strokeColorSpace->copy(); } if (fillPattern) { fillPattern = state->fillPattern->copy(); } if (strokePattern) { strokePattern = state->strokePattern->copy(); } for (i = 0; i < 4; ++i) { if (transfer[i]) { transfer[i] = state->transfer[i]->copy(); } } if (lineDashLength > 0) { lineDash = (double *)gmallocn(lineDashLength, sizeof(double)); memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double)); } if (font) font->incRefCnt(); saved = NULL; }
DoS Exec Code Overflow
0
GfxState::GfxState(GfxState *state) { int i; memcpy(this, state, sizeof(GfxState)); if (fillColorSpace) { fillColorSpace = state->fillColorSpace->copy(); } if (strokeColorSpace) { strokeColorSpace = state->strokeColorSpace->copy(); } if (fillPattern) { fillPattern = state->fillPattern->copy(); } if (strokePattern) { strokePattern = state->strokePattern->copy(); } for (i = 0; i < 4; ++i) { if (transfer[i]) { transfer[i] = state->transfer[i]->copy(); } } if (lineDashLength > 0) { lineDash = (double *)gmallocn(lineDashLength, sizeof(double)); memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double)); } if (font) font->incRefCnt(); saved = NULL; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
773
GfxSubpath::GfxSubpath(double x1, double y1) { size = 16; x = (double *)gmallocn(size, sizeof(double)); y = (double *)gmallocn(size, sizeof(double)); curve = (GBool *)gmallocn(size, sizeof(GBool)); n = 1; x[0] = x1; y[0] = y1; curve[0] = gFalse; closed = gFalse; }
DoS Exec Code Overflow
0
GfxSubpath::GfxSubpath(double x1, double y1) { size = 16; x = (double *)gmallocn(size, sizeof(double)); y = (double *)gmallocn(size, sizeof(double)); curve = (GBool *)gmallocn(size, sizeof(GBool)); n = 1; x[0] = x1; y[0] = y1; curve[0] = gFalse; closed = gFalse; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
774
GfxSubpath::GfxSubpath(GfxSubpath *subpath) { size = subpath->size; n = subpath->n; x = (double *)gmallocn(size, sizeof(double)); y = (double *)gmallocn(size, sizeof(double)); curve = (GBool *)gmallocn(size, sizeof(GBool)); memcpy(x, subpath->x, n * sizeof(double)); memcpy(y, subpath->y, n * sizeof(double)); memcpy(curve, subpath->curve, n * sizeof(GBool)); closed = subpath->closed; }
DoS Exec Code Overflow
0
GfxSubpath::GfxSubpath(GfxSubpath *subpath) { size = subpath->size; n = subpath->n; x = (double *)gmallocn(size, sizeof(double)); y = (double *)gmallocn(size, sizeof(double)); curve = (GBool *)gmallocn(size, sizeof(GBool)); memcpy(x, subpath->x, n * sizeof(double)); memcpy(y, subpath->y, n * sizeof(double)); memcpy(curve, subpath->curve, n * sizeof(GBool)); closed = subpath->closed; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
775
GfxTilingPattern::GfxTilingPattern(int paintTypeA, int tilingTypeA, double *bboxA, double xStepA, double yStepA, Object *resDictA, double *matrixA, Object *contentStreamA): GfxPattern(1) { int i; paintType = paintTypeA; tilingType = tilingTypeA; for (i = 0; i < 4; ++i) { bbox[i] = bboxA[i]; } xStep = xStepA; yStep = yStepA; resDictA->copy(&resDict); for (i = 0; i < 6; ++i) { matrix[i] = matrixA[i]; } contentStreamA->copy(&contentStream); }
DoS Exec Code Overflow
0
GfxTilingPattern::GfxTilingPattern(int paintTypeA, int tilingTypeA, double *bboxA, double xStepA, double yStepA, Object *resDictA, double *matrixA, Object *contentStreamA): GfxPattern(1) { int i; paintType = paintTypeA; tilingType = tilingTypeA; for (i = 0; i < 4; ++i) { bbox[i] = bboxA[i]; } xStep = xStepA; yStep = yStepA; resDictA->copy(&resDict); for (i = 0; i < 6; ++i) { matrix[i] = matrixA[i]; } contentStreamA->copy(&contentStream); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
776
void GfxPath::append(GfxPath *path) { int i; if (n + path->n > size) { size = n + path->n; subpaths = (GfxSubpath **) greallocn(subpaths, size, sizeof(GfxSubpath *)); } for (i = 0; i < path->n; ++i) { subpaths[n++] = path->subpaths[i]->copy(); } justMoved = gFalse; }
DoS Exec Code Overflow
0
void GfxPath::append(GfxPath *path) { int i; if (n + path->n > size) { size = n + path->n; subpaths = (GfxSubpath **) greallocn(subpaths, size, sizeof(GfxSubpath *)); } for (i = 0; i < path->n; ++i) { subpaths[n++] = path->subpaths[i]->copy(); } justMoved = gFalse; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
777
void GfxState::clearPath() { delete path; path = new GfxPath(); }
DoS Exec Code Overflow
0
void GfxState::clearPath() { delete path; path = new GfxPath(); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
778
void GfxState::clip() { double xMin, yMin, xMax, yMax, x, y; GfxSubpath *subpath; int i, j; xMin = xMax = yMin = yMax = 0; // make gcc happy for (i = 0; i < path->getNumSubpaths(); ++i) { subpath = path->getSubpath(i); for (j = 0; j < subpath->getNumPoints(); ++j) { transform(subpath->getX(j), subpath->getY(j), &x, &y); if (i == 0 && j == 0) { xMin = xMax = x; yMin = yMax = y; } else { if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } } } } if (xMin > clipXMin) { clipXMin = xMin; } if (yMin > clipYMin) { clipYMin = yMin; } if (xMax < clipXMax) { clipXMax = xMax; } if (yMax < clipYMax) { clipYMax = yMax; } }
DoS Exec Code Overflow
0
void GfxState::clip() { double xMin, yMin, xMax, yMax, x, y; GfxSubpath *subpath; int i, j; xMin = xMax = yMin = yMax = 0; // make gcc happy for (i = 0; i < path->getNumSubpaths(); ++i) { subpath = path->getSubpath(i); for (j = 0; j < subpath->getNumPoints(); ++j) { transform(subpath->getX(j), subpath->getY(j), &x, &y); if (i == 0 && j == 0) { xMin = xMax = x; yMin = yMax = y; } else { if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } } } } if (xMin > clipXMin) { clipXMin = xMin; } if (yMin > clipYMin) { clipYMin = yMin; } if (xMax < clipXMax) { clipXMax = xMax; } if (yMax < clipYMax) { clipYMax = yMax; } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
779
static inline double clip01(double x) { return (x < 0) ? 0 : (x > 1) ? 1 : x; }
DoS Exec Code Overflow
0
static inline double clip01(double x) { return (x < 0) ? 0 : (x > 1) ? 1 : x; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
780
void GfxState::clipToStrokePath() { double xMin, yMin, xMax, yMax, x, y, t0, t1; GfxSubpath *subpath; int i, j; xMin = xMax = yMin = yMax = 0; // make gcc happy for (i = 0; i < path->getNumSubpaths(); ++i) { subpath = path->getSubpath(i); for (j = 0; j < subpath->getNumPoints(); ++j) { transform(subpath->getX(j), subpath->getY(j), &x, &y); if (i == 0 && j == 0) { xMin = xMax = x; yMin = yMax = y; } else { if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } } } } t0 = fabs(ctm[0]); t1 = fabs(ctm[2]); if (t0 > t1) { xMin -= 0.5 * lineWidth * t0; xMax += 0.5 * lineWidth * t0; } else { xMin -= 0.5 * lineWidth * t1; xMax += 0.5 * lineWidth * t1; } t0 = fabs(ctm[0]); t1 = fabs(ctm[3]); if (t0 > t1) { yMin -= 0.5 * lineWidth * t0; yMax += 0.5 * lineWidth * t0; } else { yMin -= 0.5 * lineWidth * t1; yMax += 0.5 * lineWidth * t1; } if (xMin > clipXMin) { clipXMin = xMin; } if (yMin > clipYMin) { clipYMin = yMin; } if (xMax < clipXMax) { clipXMax = xMax; } if (yMax < clipYMax) { clipYMax = yMax; } }
DoS Exec Code Overflow
0
void GfxState::clipToStrokePath() { double xMin, yMin, xMax, yMax, x, y, t0, t1; GfxSubpath *subpath; int i, j; xMin = xMax = yMin = yMax = 0; // make gcc happy for (i = 0; i < path->getNumSubpaths(); ++i) { subpath = path->getSubpath(i); for (j = 0; j < subpath->getNumPoints(); ++j) { transform(subpath->getX(j), subpath->getY(j), &x, &y); if (i == 0 && j == 0) { xMin = xMax = x; yMin = yMax = y; } else { if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } } } } t0 = fabs(ctm[0]); t1 = fabs(ctm[2]); if (t0 > t1) { xMin -= 0.5 * lineWidth * t0; xMax += 0.5 * lineWidth * t0; } else { xMin -= 0.5 * lineWidth * t1; xMax += 0.5 * lineWidth * t1; } t0 = fabs(ctm[0]); t1 = fabs(ctm[3]); if (t0 > t1) { yMin -= 0.5 * lineWidth * t0; yMax += 0.5 * lineWidth * t0; } else { yMin -= 0.5 * lineWidth * t1; yMax += 0.5 * lineWidth * t1; } if (xMin > clipXMin) { clipXMin = xMin; } if (yMin > clipYMin) { clipYMin = yMin; } if (xMax < clipXMax) { clipXMax = xMax; } if (yMax < clipYMax) { clipYMax = yMax; } }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
781
void GfxSubpath::close() { if (x[n-1] != x[0] || y[n-1] != y[0]) { lineTo(x[0], y[0]); } closed = gTrue; }
DoS Exec Code Overflow
0
void GfxSubpath::close() { if (x[n-1] != x[0] || y[n-1] != y[0]) { lineTo(x[0], y[0]); } closed = gTrue; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
782
void GfxPath::close() { if (justMoved) { if (n >= size) { size += 16; subpaths = (GfxSubpath **) greallocn(subpaths, size, sizeof(GfxSubpath *)); } subpaths[n] = new GfxSubpath(firstX, firstY); ++n; justMoved = gFalse; } subpaths[n-1]->close(); }
DoS Exec Code Overflow
0
void GfxPath::close() { if (justMoved) { if (n >= size) { size += 16; subpaths = (GfxSubpath **) greallocn(subpaths, size, sizeof(GfxSubpath *)); } subpaths[n] = new GfxSubpath(firstX, firstY); ++n; justMoved = gFalse; } subpaths[n-1]->close(); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
783
GfxColorSpace *GfxDeviceGrayColorSpace::copy() { return new GfxDeviceGrayColorSpace(); }
DoS Exec Code Overflow
0
GfxColorSpace *GfxDeviceGrayColorSpace::copy() { return new GfxDeviceGrayColorSpace(); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
784
GfxColorSpace *GfxCalGrayColorSpace::copy() { GfxCalGrayColorSpace *cs; cs = new GfxCalGrayColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->gamma = gamma; return cs; }
DoS Exec Code Overflow
0
GfxColorSpace *GfxCalGrayColorSpace::copy() { GfxCalGrayColorSpace *cs; cs = new GfxCalGrayColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->gamma = gamma; return cs; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
785
GfxColorSpace *GfxDeviceRGBColorSpace::copy() { return new GfxDeviceRGBColorSpace(); }
DoS Exec Code Overflow
0
GfxColorSpace *GfxDeviceRGBColorSpace::copy() { return new GfxDeviceRGBColorSpace(); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
786
GfxColorSpace *GfxCalRGBColorSpace::copy() { GfxCalRGBColorSpace *cs; int i; cs = new GfxCalRGBColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->gammaR = gammaR; cs->gammaG = gammaG; cs->gammaB = gammaB; for (i = 0; i < 9; ++i) { cs->mat[i] = mat[i]; } return cs; }
DoS Exec Code Overflow
0
GfxColorSpace *GfxCalRGBColorSpace::copy() { GfxCalRGBColorSpace *cs; int i; cs = new GfxCalRGBColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->gammaR = gammaR; cs->gammaG = gammaG; cs->gammaB = gammaB; for (i = 0; i < 9; ++i) { cs->mat[i] = mat[i]; } return cs; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
787
GfxColorSpace *GfxLabColorSpace::copy() { GfxLabColorSpace *cs; cs = new GfxLabColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->aMin = aMin; cs->aMax = aMax; cs->bMin = bMin; cs->bMax = bMax; cs->kr = kr; cs->kg = kg; cs->kb = kb; return cs; }
DoS Exec Code Overflow
0
GfxColorSpace *GfxLabColorSpace::copy() { GfxLabColorSpace *cs; cs = new GfxLabColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->aMin = aMin; cs->aMax = aMax; cs->bMin = bMin; cs->bMax = bMax; cs->kr = kr; cs->kg = kg; cs->kb = kb; return cs; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
788
GfxColorSpace *GfxPatternColorSpace::copy() { return new GfxPatternColorSpace(under ? under->copy() : (GfxColorSpace *)NULL); }
DoS Exec Code Overflow
0
GfxColorSpace *GfxPatternColorSpace::copy() { return new GfxPatternColorSpace(under ? under->copy() : (GfxColorSpace *)NULL); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
789
GfxPattern *GfxShadingPattern::copy() { return new GfxShadingPattern(shading->copy(), matrix); }
DoS Exec Code Overflow
0
GfxPattern *GfxShadingPattern::copy() { return new GfxShadingPattern(shading->copy(), matrix); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
790
GfxShading *GfxFunctionShading::copy() { return new GfxFunctionShading(this); }
DoS Exec Code Overflow
0
GfxShading *GfxFunctionShading::copy() { return new GfxFunctionShading(this); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
791
GfxShading *GfxAxialShading::copy() { return new GfxAxialShading(this); }
DoS Exec Code Overflow
0
GfxShading *GfxAxialShading::copy() { return new GfxAxialShading(this); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
792
GfxShading *GfxRadialShading::copy() { return new GfxRadialShading(this); }
DoS Exec Code Overflow
0
GfxShading *GfxRadialShading::copy() { return new GfxRadialShading(this); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
793
GfxShading *GfxGouraudTriangleShading::copy() { return new GfxGouraudTriangleShading(this); }
DoS Exec Code Overflow
0
GfxShading *GfxGouraudTriangleShading::copy() { return new GfxGouraudTriangleShading(this); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
794
GfxShading *GfxPatchMeshShading::copy() { return new GfxPatchMeshShading(this); }
DoS Exec Code Overflow
0
GfxShading *GfxPatchMeshShading::copy() { return new GfxPatchMeshShading(this); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
795
void GfxShadingBitBuf::flushBits() { bitBuf = 0; nBits = 0; }
DoS Exec Code Overflow
0
void GfxShadingBitBuf::flushBits() { bitBuf = 0; nBits = 0; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
796
GBool GfxShadingBitBuf::getBits(int n, Guint *val) { int x; if (nBits >= n) { x = (bitBuf >> (nBits - n)) & ((1 << n) - 1); nBits -= n; } else { x = 0; if (nBits > 0) { x = bitBuf & ((1 << nBits) - 1); n -= nBits; nBits = 0; } while (n > 0) { if ((bitBuf = str->getChar()) == EOF) { nBits = 0; return gFalse; } if (n >= 8) { x = (x << 8) | bitBuf; n -= 8; } else { x = (x << n) | (bitBuf >> (8 - n)); nBits = 8 - n; n = 0; } } } *val = x; return gTrue; }
DoS Exec Code Overflow
0
GBool GfxShadingBitBuf::getBits(int n, Guint *val) { int x; if (nBits >= n) { x = (bitBuf >> (nBits - n)) & ((1 << n) - 1); nBits -= n; } else { x = 0; if (nBits > 0) { x = bitBuf & ((1 << nBits) - 1); n -= nBits; nBits = 0; } while (n > 0) { if ((bitBuf = str->getChar()) == EOF) { nBits = 0; return gFalse; } if (n >= 8) { x = (x << 8) | bitBuf; n -= 8; } else { x = (x << n) | (bitBuf >> (8 - n)); nBits = 8 - n; n = 0; } } } *val = x; return gTrue; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
797
unsigned int GfxColorSpace::getCMSColorSpaceType(icColorSpaceSignature cs) { switch (cs) { case icSigXYZData: return PT_XYZ; break; case icSigLabData: return PT_Lab; break; case icSigLuvData: return PT_YUV; break; case icSigYCbCrData: return PT_YCbCr; break; case icSigYxyData: return PT_Yxy; break; case icSigRgbData: return PT_RGB; break; case icSigGrayData: return PT_GRAY; break; case icSigHsvData: return PT_HSV; break; case icSigHlsData: return PT_HLS; break; case icSigCmykData: return PT_CMYK; break; case icSigCmyData: return PT_CMY; break; case icSig2colorData: case icSig3colorData: case icSig4colorData: case icSig5colorData: case icSig6colorData: case icSig7colorData: case icSig8colorData: case icSig9colorData: case icSig10colorData: case icSig11colorData: case icSig12colorData: case icSig13colorData: case icSig14colorData: case icSig15colorData: default: break; } return PT_RGB; }
DoS Exec Code Overflow
0
unsigned int GfxColorSpace::getCMSColorSpaceType(icColorSpaceSignature cs) { switch (cs) { case icSigXYZData: return PT_XYZ; break; case icSigLabData: return PT_Lab; break; case icSigLuvData: return PT_YUV; break; case icSigYCbCrData: return PT_YCbCr; break; case icSigYxyData: return PT_Yxy; break; case icSigRgbData: return PT_RGB; break; case icSigGrayData: return PT_GRAY; break; case icSigHsvData: return PT_HSV; break; case icSigHlsData: return PT_HLS; break; case icSigCmykData: return PT_CMYK; break; case icSigCmyData: return PT_CMY; break; case icSig2colorData: case icSig3colorData: case icSig4colorData: case icSig5colorData: case icSig6colorData: case icSig7colorData: case icSig8colorData: case icSig9colorData: case icSig10colorData: case icSig11colorData: case icSig12colorData: case icSig13colorData: case icSig14colorData: case icSig15colorData: default: break; } return PT_RGB; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
798
void GfxDeviceGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) { cmyk->c = cmyk->m = cmyk->y = 0; cmyk->k = clip01(gfxColorComp1 - color->c[0]); }
DoS Exec Code Overflow
0
void GfxDeviceGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) { cmyk->c = cmyk->m = cmyk->y = 0; cmyk->k = clip01(gfxColorComp1 - color->c[0]); }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null
799
void GfxCalGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) { GfxRGB rgb; GfxColorComp c, m, y, k; #ifdef USE_CMS if (XYZ2DisplayTransform != NULL && displayPixelType == PT_CMYK) { double in[gfxColorMaxComps]; Guchar out[gfxColorMaxComps]; double X, Y, Z; getXYZ(color,&X,&Y,&Z); in[0] = clip01(X); in[1] = clip01(Y); in[2] = clip01(Z); XYZ2DisplayTransform->doTransform(in,out,1); cmyk->c = byteToCol(out[0]); cmyk->m = byteToCol(out[1]); cmyk->y = byteToCol(out[2]); cmyk->k = byteToCol(out[3]); return; } #endif getRGB(color, &rgb); c = clip01(gfxColorComp1 - rgb.r); m = clip01(gfxColorComp1 - rgb.g); y = clip01(gfxColorComp1 - rgb.b); k = c; if (m < k) { k = m; } if (y < k) { k = y; } cmyk->c = c - k; cmyk->m = m - k; cmyk->y = y - k; cmyk->k = k; }
DoS Exec Code Overflow
0
void GfxCalGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) { GfxRGB rgb; GfxColorComp c, m, y, k; #ifdef USE_CMS if (XYZ2DisplayTransform != NULL && displayPixelType == PT_CMYK) { double in[gfxColorMaxComps]; Guchar out[gfxColorMaxComps]; double X, Y, Z; getXYZ(color,&X,&Y,&Z); in[0] = clip01(X); in[1] = clip01(Y); in[2] = clip01(Z); XYZ2DisplayTransform->doTransform(in,out,1); cmyk->c = byteToCol(out[0]); cmyk->m = byteToCol(out[1]); cmyk->y = byteToCol(out[2]); cmyk->k = byteToCol(out[3]); return; } #endif getRGB(color, &rgb); c = clip01(gfxColorComp1 - rgb.r); m = clip01(gfxColorComp1 - rgb.g); y = clip01(gfxColorComp1 - rgb.b); k = c; if (m < k) { k = m; } if (y < k) { k = y; } cmyk->c = c - k; cmyk->m = m - k; cmyk->y = y - k; cmyk->k = k; }
@@ -1849,7 +1849,7 @@ void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) int i, j, n; n = base->getNComps(); - line = (Guchar *) gmalloc (length * n); + line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; @@ -4072,7 +4072,7 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, nComps2 = colorSpace2->getNComps(); lookup2 = indexedCS->getLookup(); colorSpace2->getDefaultRanges(x, y, indexHigh); - byte_lookup = (Guchar *)gmalloc ((maxPixel + 1) * nComps2); + byte_lookup = (Guchar *)gmallocn ((maxPixel + 1), nComps2); for (k = 0; k < nComps2; ++k) { lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1, sizeof(GfxColorComp)); @@ -4220,7 +4220,7 @@ void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j]; @@ -4250,7 +4250,7 @@ void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) { switch (colorSpace->getMode()) { case csIndexed: case csSeparation: - tmp_line = (Guchar *) gmalloc (length * nComps2); + tmp_line = (Guchar *) gmallocn (length, nComps2); for (i = 0; i < length; i++) { for (j = 0; j < nComps2; j++) { tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
CWE-189
null
null