[cairo] segmentation fault during poppler_page_render()

Dan Raymond draymond at foxvalley.net
Sun Mar 8 17:54:58 PDT 2015


Here is the gdb info:

Program received signal SIGSEGV, Segmentation fault.
0x68fe680d in libcairo-2!cairo_font_options_get_hint_metrics ()
    from C:\msys2\home\Dan\pkg\libcairo-2.dll


On 3/8/2015 5:50 PM, Dan Raymond wrote:
> Is there something wrong with the following code snippet?  I am 
> getting intermittent segmentation faults during poppler_page_render().
>
>
>    // Paint the drawing area grey and then fill the PDF rendering area 
> with white.  This will
>    // prevent the background from bleeding through any areas that are 
> not rendered by the PDF.
>
>    surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 
> window_width, window_height);
>    cr = cairo_create(surface);
>    cairo_set_source_rgb(cr, 0.33, 0.33, 0.33);  // grey background
>    cairo_paint(cr);
>    cairo_rectangle(cr, x_padding, y_padding, pdf_width, pdf_height);
>    cairo_set_source_rgb(cr, 1, 1, 1);
>    cairo_fill(cr);
>
>    // Render the PDF.
>
>    cairo_translate(cr, x_padding, y_padding);
>    cairo_scale(cr, scale_factor, scale_factor);
>    poppler_page_render(page, cr);
>    cairo_destroy(cr);
>    // (use the rendered surface here)
>    cairo_surface_destroy(surface);
>



More information about the cairo mailing list