[poppler] poppler/poppler: CairoOutputDev.cc,1.34,1.35

Jeff Muizelaar jrmuizel at kemper.freedesktop.org
Thu Apr 27 10:26:39 PDT 2006


Update of /cvs/poppler/poppler/poppler
In directory kemper:/tmp/cvs-serv24910/poppler

Modified Files:
	CairoOutputDev.cc 
Log Message:
2006-04-27  Jeff Muizelaar  <jeff at 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.


Index: CairoOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.cc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- CairoOutputDev.cc	12 Apr 2006 06:52:07 -0000	1.34
+++ CairoOutputDev.cc	27 Apr 2006 17:26:37 -0000	1.35
@@ -525,11 +525,15 @@
 
   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 @@
   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 @@
   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 @@
 						 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",



More information about the poppler mailing list