[cairo-bugs] [Bug 96482] New: Cairo 1.15.2: Crash in cairo_fill if target surface is created with cairo_win32_surface_create

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jun 10 16:28:31 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=96482

            Bug ID: 96482
           Summary: Cairo 1.15.2: Crash in cairo_fill if target surface is
                    created with cairo_win32_surface_create
           Product: cairo
           Version: unspecified
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: win32 backend
          Assignee: cairo-bugs at cairographics.org
          Reporter: artwik at wp.pl
        QA Contact: cairo-bugs at cairographics.org

Environment: Cairo 1.15.2, Windows 7 x64.

When DC passed to cairo_win32_surface_create() has device origin (x or y
coordinate) > 0 (set with SetViewportOrgEx Win API) then there is raised an
"access violation" error when cairo_fill() is invoked.
If x and y coordinates of DC origin <= 0 then everything works fine.

You can find below a code snippet to reproduce the issue:

const int devX = 10;
const int devY = 0;

HDC hdc = ::CreateCompatibleDC(NULL);
HBITMAP hbmp = CreateCompatibleBitmap(hdc, 100, 100);
HGDIOBJ hObjPrev = ::SelectObject(hdc, hbmp);
::SetViewportOrgEx(hdc, devX, devY, NULL);

cairo_surface_t* surface = cairo_win32_surface_create(hdc);
cairo_t* context = cairo_create(surface);

cairo_rectangle(context, 0, 0, 90, 90);

cairo_set_source_rgba(context, 0, 1, 0, 0.5);
cairo_set_fill_rule(context, CAIRO_FILL_RULE_EVEN_ODD);
cairo_fill(context);
cairo_destroy(context);
cairo_surface_write_to_png(surface, "test.png");
cairo_surface_destroy(surface);

::SelectObject(hdc, hObjPrev);
::DeleteObject(hbmp);
::DeleteDC(hdc);

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20160610/20bcb74f/attachment.html>


More information about the cairo-bugs mailing list