File libdocument-return-96-dpi-if-unable-to-determine.patch of Package evince.11494

commit fafa2603d553ed3f81e5780cb8f8c16957d505eb
Author: Stefano Facchini <stefano.facchini@gmail.com>
Date:   Sun Sep 10 21:41:48 2017 +0200

    libdocument: return 96 DPI if unable to determine true value
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719400

Index: evince-3.26.0/libdocument/ev-document-misc.c
===================================================================
--- evince-3.26.0.orig/libdocument/ev-document-misc.c
+++ evince-3.26.0/libdocument/ev-document-misc.c
@@ -513,9 +513,13 @@ ev_document_misc_get_screen_dpi (GdkScre
 
 	/*diagonal in pixels*/
 	dp = hypot (gdk_screen_get_width (screen), gdk_screen_get_height (screen));
+	if (dp == 0)
+		return 96;
 
 	/*diagonal in inches*/
 	di = hypot (gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm (screen)) / 25.4;
+	if (di == 0)
+		return 96;
 
 	return (dp / di);
 }