Bug 4161

Summary: _cairo_surface_clone_similar inconsistently nullchecks backend->clone_similar
Product: cairo Reporter: Christian Biesinger <cbiesinger>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high    
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch I'm applying

Description Christian Biesinger 2005-08-20 16:00:56 UTC
From Message-ID: <42F55561.80209@web.de>

_cairo_surface_clone_similar seems to do its clone_similar checking
inconsistently. If clone_similar is null, it is first checked here:
    687     if (surface->backend->clone_similar) {
    688         status = surface->backend->clone_similar (surface, src, clone_out);
    689         if (status != CAIRO_INT_STATUS_UNSUPPORTED)
    690             return status;
    691     }

But the fallback code does not nullcheck:
    697     status = surface->backend->clone_similar (surface, &image->base,
clone_out);

Seems to me like that'd crash if the backend does not implement that function...
Comment 1 Owen Taylor 2005-08-21 08:53:39 UTC
Created attachment 2962 [details] [review]
Patch I'm applying
Comment 2 Owen Taylor 2005-08-21 08:54:03 UTC
2005-08-21  Owen Taylor  <otaylor@redhat.com>

        * src/cairo-surface.c (_cairo_surface_clone_similar): Fix the
        handling of backend->clone_similar == NULL. (#4161,
        Christian Biesinger)
Comment 3 Carl Worth 2005-08-22 17:14:57 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.