[poppler] poppler/glib: poppler-page.cc,1.24,1.25

Kristian Hogsberg krh at freedesktop.org
Fri Jul 8 01:58:48 EST 2005


Update of /cvs/poppler/poppler/glib
In directory gabe:/tmp/cvs-serv20666/glib

Modified Files:
	poppler-page.cc 
Log Message:
2005-07-06  Kristian Høgsberg  <krh at redhat.com>

        * glib/poppler-page.cc (poppler_page_copy_to_pixbuf): Add out of
        bounds checking (from Marco).



Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.cc,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- poppler-page.cc	30 Jun 2005 19:44:33 -0000	1.24
+++ poppler-page.cc	7 Jul 2005 15:58:44 -0000	1.25
@@ -219,6 +219,11 @@
   pixbuf_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
   pixbuf_n_channels = gdk_pixbuf_get_n_channels (pixbuf);
 
+  if (cairo_width > gdk_pixbuf_get_width (pixbuf))
+    cairo_width = gdk_pixbuf_get_width (pixbuf);
+  if (cairo_height > gdk_pixbuf_get_height (pixbuf))
+    cairo_height = gdk_pixbuf_get_height (pixbuf);
+
   for (y = 0; y < cairo_height; y++)
     {
       src = (unsigned int *) (cairo_data + y * cairo_rowstride);



More information about the poppler mailing list