Re: [PATCH] stroker: Check for scaling overflow in computing half line widths

Miguel Gomez <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Resubmitting this to the list as I wasn't subscribed.

> > Would it be possible to a test that reproduces the issue?
> 
> Yes, Miguel has a code snippet to reproduce the crash, it could
> perfectly be a test.

Thanks for working on this guys!!

This is the test I'm using to reproduce the crash:

===============================================
#include <cairo.h>

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

    cairo_save(cr);
    cairo_matrix_t matrix;
    matrix.xx = 1.0;
    matrix.yx = 0;
    matrix.xy = 0;
    matrix.yy = 4294967295.0;
    matrix.x0 = 8.0;
    matrix.y0 = -49392123873.00;
    cairo_transform(cr, &matrix);

    cairo_rectangle(cr, 0.5, 0.5, 29.0, 22.0);
    cairo_set_line_width(cr, 1.0);
    cairo_stroke(cr);

    cairo_restore(cr);

    cairo_destroy(cr);
    cairo_surface_destroy(surface);
    
    return 0;
}
===============================================


-- 
Miguel Gomez
Igalia - www.igalia.com
-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.