projects
/
mupdf.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25e1f86
)
Bug 704833: Fix div by zero when resolution is set to zero.
author
Sebastian Rasmussen
<
[email protected]
>
Mon, 10 Oct 2022 16:39:18 +0000
(18:39 +0200)
committer
Sebastian Rasmussen
<
[email protected]
>
Mon, 10 Oct 2022 16:51:46 +0000
(18:51 +0200)
Take the opportunity to handle negative resolutions the same way.
source/tools/muraster.c
patch
|
blob
|
blame
|
history
diff --git
a/source/tools/muraster.c
b/source/tools/muraster.c
index 02d2d5ba2f1433d7e0f164b3be671278f5c4ff26..ee44ee778f75c12409afb545301dcbf7e1bd2548 100644
(file)
--- a/
source/tools/muraster.c
+++ b/
source/tools/muraster.c
@@
-1421,6
+1421,13
@@
read_resolution(const char *arg)
y_resolution = fz_atoi(arg);
else
y_resolution = x_resolution;
+
+ if (x_resolution <= 0 || y_resolution <= 0)
+ {
+ fprintf(stderr, "Ignoring invalid resolution\n");
+ x_resolution = X_RESOLUTION;
+ y_resolution = Y_RESOLUTION;
+ }
}
static int