Bug 4161 - _cairo_surface_clone_similar inconsistently nullchecks backend->clone_similar
Summary: _cairo_surface_clone_similar inconsistently nullchecks backend->clone_similar
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-20 16:00 UTC by Christian Biesinger
Modified: 2005-08-22 00:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch I'm applying (1.61 KB, patch)
2005-08-21 08:53 UTC, Owen Taylor
Details | Splinter Review

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.