Commit af3f38a4 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Prevent division by zero and force ghostscript run

The `scale` variable can be zero since it's an int. This code should
probably be refactored to use floats, but since no one touched it in
years, this is a quick workaround to not make it crash and to get a
working thumbnail by forcing a ghostscript run with the `break;`.

BUG: 406463
FIXED-IN: 19.12.1
parent c3d28271
......@@ -278,6 +278,7 @@ bool GSCreator::create(const QString &path, int width, int height, QImage &img)
const int xscale = bbox->width() / width;
const int yscale = bbox->height() / height;
const int scale = xscale < yscale ? xscale : yscale;
if (scale == 0) break;
if (getEPSIPreview(path,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment