From 582d3f6be3e987e96e05eb79b1814816b8d71638 Mon Sep 17 00:00:00 2001 From: Georgy Komarov Date: Sun, 23 Aug 2020 20:44:45 +0300 Subject: [PATCH] Fix invalid zoom when opening document with "adjust-open width" option This commit fixes attempt to set INFINITY zoom value when opening document for first time with "adjust-open width" option. In this case function zathura_document_get_document_size returns 0 width which leads to incorrect zoom calculation. --- zathura/zathura.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index 6a4d475..4185ff1 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -1685,7 +1685,7 @@ adjust_view(zathura_t* zathura) zathura_document_get_document_size(zathura->document, &document_height, &document_width); zathura_document_get_viewport_size(zathura->document, &view_height, &view_width); - if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0) { + if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0 || document_width == 0) { goto error_ret; }