summaryrefslogtreecommitdiff
path: root/poppler
diff options
context:
space:
mode:
authorJeff Muizelaar <jeff@infidigm.net>2006-04-27 17:26:36 +0000
committerJeff Muizelaar <jeff@infidigm.net>2006-04-27 17:26:36 +0000
commit960d60467d62d28f20b127d07e8de1af42eec568 (patch)
tree2c70996c58fd8d03610d39bdd6ecd2be5323210e /poppler
parent155112131c6e25bfde752cf5daa80a6c9712cfed (diff)
2006-04-27 Jeff Muizelaar <jeff@infidigm.net>
* poppler/CairoOutputDev.cc: delete imgStr if some of the cairo functions fail. Fixes coverty reports #2106, #2107, #2077 and bug #6764. Patch by Kjartan Maraas.
Diffstat (limited to 'poppler')
-rw-r--r--poppler/CairoOutputDev.cc34
1 files changed, 25 insertions, 9 deletions
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 654df1bd..04682ed2 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -525,11 +525,15 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_A8,
width, height, row_stride);
- if (image == NULL)
+ if (image == NULL) {
+ delete imgStr;
return;
+ }
pattern = cairo_pattern_create_for_surface (image);
- if (pattern == NULL)
+ if (pattern == NULL) {
+ delete imgStr;
return;
+ }
cairo_matrix_invert (&matrix);
cairo_pattern_set_matrix (pattern, &matrix);
@@ -624,12 +628,16 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_RGB24,
width, height, width * 4);
- if (image == NULL)
+ if (image == NULL) {
+ delete imgStr;
return;
+ }
pattern = cairo_pattern_create_for_surface (image);
maskPattern = cairo_pattern_create_for_surface (maskImage);
- if (pattern == NULL)
+ if (pattern == NULL) {
+ delete imgStr;
return;
+ }
ctm = state->getCTM();
LOG (printf ("drawImageMask %dx%d, matrix: %f, %f, %f, %f, %f, %f\n",
@@ -735,12 +743,16 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s
image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_RGB24,
width, height, width * 4);
- if (image == NULL)
+ if (image == NULL) {
+ delete imgStr;
return;
+ }
pattern = cairo_pattern_create_for_surface (image);
maskPattern = cairo_pattern_create_for_surface (maskImage);
- if (pattern == NULL)
+ if (pattern == NULL) {
+ delete imgStr;
return;
+ }
ctm = state->getCTM();
LOG (printf ("drawImageMask %dx%d, matrix: %f, %f, %f, %f, %f, %f\n",
@@ -843,11 +855,15 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
width, height, width * 4);
}
- if (image == NULL)
- return;
+ if (image == NULL) {
+ delete imgStr;
+ return;
+ }
pattern = cairo_pattern_create_for_surface (image);
- if (pattern == NULL)
+ if (pattern == NULL) {
+ delete imgStr;
return;
+ }
ctm = state->getCTM();
LOG (printf ("drawImageMask %dx%d, matrix: %f, %f, %f, %f, %f, %f\n",