diff options
author | monsta <[email protected]> | 2017-11-02 12:17:07 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-11-02 12:17:07 +0300 |
commit | c3994eadcb093174ac52bd6b62c742bf716f4190 (patch) | |
tree | a737aa8903003fa041ee6208f90c8813ddb4fbb8 | |
parent | d18e5e942d1ed8b0649ebadeb29c109887ca2c51 (diff) | |
download | atril-c3994eadcb093174ac52bd6b62c742bf716f4190.tar.bz2 atril-c3994eadcb093174ac52bd6b62c742bf716f4190.tar.xz |
fix crash when selecting text in djvu documents
fixes https://github.com/mate-desktop/atril/issues/283
taken from:
https://git.gnome.org/browse/evince/commit/?id=c5a338c00253aeb88901c574ea150b3bd83634e7
-rw-r--r-- | libview/ev-pixbuf-cache.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c index 1e5402e4..6db650fc 100644 --- a/libview/ev-pixbuf-cache.c +++ b/libview/ev-pixbuf-cache.c @@ -297,7 +297,8 @@ copy_job_to_job_info (EvJobRender *job_render, job_info->selection_points = job_render->selection_points; job_info->selection = cairo_surface_reference (job_render->selection); job_info->selection_scale = job_render->scale; - set_device_scale_on_surface (job_info->selection, job_info->device_scale); + if (job_info->selection) + set_device_scale_on_surface (job_info->selection, job_info->device_scale); g_assert (job_info->selection_points.x1 >= 0); job_info->selection_region_points = job_render->selection_points; @@ -1089,7 +1090,8 @@ ev_pixbuf_cache_get_selection_surface (EvPixbufCache *pixbuf_cache, old_points, job_info->selection_style, &text, &base); - set_device_scale_on_surface (job_info->selection, job_info->device_scale); + if (job_info->selection) + set_device_scale_on_surface (job_info->selection, job_info->device_scale); job_info->selection_points = job_info->target_points; job_info->selection_scale = scale; g_object_unref (rc); |