[cairo-bugs] [Bug 15761] cairo_surface_set_device_offset crashes pidgin on windows

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 15 18:07:17 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=15761





--- Comment #8 from David Grohmann <dave1g at satx.rr.com>  2008-07-15 18:07:14 PST ---
_gdk_drawable_ref_cairo_surface() can return NULL, but
gdk_window_begin_paint_region() does not check if it did so before passing the
result to cairo_surface_set_device_offset(), which also doesn't check if it's
NULL before dereferencing it. 

Is it possible my error is a NULL pointer dereference?
-------------------------------------------------------
Excerpt from gdkwindow.c line 970-1026 
...
void          
gdk_window_begin_paint_region (GdkWindow *window,
                               GdkRegion *region)
{
...
  paint->surface = _gdk_drawable_ref_cairo_surface (paint->pixmap);
  cairo_surface_set_device_offset (paint->surface,
                                   - paint->x_offset, - paint->y_offset);
...
}
...
-------------------------------------------------------
Excerpt from  gdkdraw.c lines 1257-1275
...
/**
 * _gdk_drawable_ref_cairo_surface:
 * @drawable: a #GdkDrawable
 * 
 * Obtains a #cairo_surface_t for the given drawable. If a
 * #cairo_surface_t for the drawable already exists, it will be
 * referenced, otherwise a new surface will be created.
 * 
 * Return value: a newly referenced #cairo_surface_t that points
 *  to @drawable. Unref with cairo_surface_destroy()
 **/
cairo_surface_t *
_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable)
{
  g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);

  return GDK_DRAWABLE_GET_CLASS (drawable)->ref_cairo_surface (drawable);
}
....


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the cairo-bugs mailing list