[cairo-bugs] [Bug 75705] New: "double free or corruption" error appeares while i try to draw dotted line

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 3 03:25:05 PST 2014


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

          Priority: medium
            Bug ID: 75705
          Assignee: chris at chris-wilson.co.uk
           Summary: "double free or corruption" error appeares while i try
                    to draw dotted line
        QA Contact: cairo-bugs at cairographics.org
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: pserg.sema at gmail.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: 1.12.16
         Component: general
           Product: cairo

/*

"double free or corruption" error appeares while i try to draw dotted line

in case I comment line:

cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);

or change antialias type to CAIRO_ANTIALIAS_BEST

- all work properly

*/

#include<cstdio>
#include<cairo/cairo.h>

int main()
{
    cairo_surface_t *surface;
    cairo_t *cr;
    surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 256, 256);
    cr = cairo_create(surface);

    cairo_set_source_rgba(cr, 0, 0, 0, 1);
    cairo_paint(cr);

    cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
    cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND);

    cairo_new_path(cr);

    cairo_move_to(cr, 100, 251);
    cairo_line_to(cr, 100, 196);

    cairo_move_to(cr, 36, 3);
    cairo_line_to(cr, 107, 3);

    cairo_set_antialias(cr, CAIRO_ANTIALIAS_FAST);
    cairo_set_tolerance(cr, 1);

    double dsh[2] = {1,3};

    cairo_set_dash(cr, dsh, 2, 0);
    cairo_set_source_rgba(cr, 1, 1, 1, 1);
    cairo_set_line_width(cr, 2);

    cairo_stroke(cr);

    cairo_destroy (cr);
    cairo_surface_write_to_png (surface, "hello.png");
    cairo_surface_destroy (surface);

    return 0;
}

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


More information about the cairo-bugs mailing list