diff options
author | Oliver Sander <oliver.sander@tu-dresden.de> | 2022-08-06 09:53:52 +0200 |
---|---|---|
committer | Oliver Sander <oliver.sander@tu-dresden.de> | 2022-08-06 09:53:52 +0200 |
commit | 58e30f9aac59437c438b973bedc6a7982349c63a (patch) | |
tree | 9a9487e0dee29be93cfe2b50706ce485703ce83b | |
parent | 56a7f817567d65ce62bea03af27c0e60340116f4 (diff) |
Do not truncate line dash patterns with more than 20 entries
Because otherwise files with longer patterns will not render
correctly. One example is the file in
https://gitlab.freedesktop.org/poppler/poppler/-/issues/1281
Fixes: 1281
-rw-r--r-- | poppler/SplashOutputDev.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 695f867a..c690b5d3 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -53,6 +53,7 @@ #include <cstring> #include <cmath> +#include <vector> #include "goo/gfile.h" #include "GlobalParams.h" #include "Error.h" @@ -1473,20 +1474,18 @@ void SplashOutputDev::updateLineDash(GfxState *state) double *dashPattern; int dashLength; double dashStart; - SplashCoord dash[20]; int i; state->getLineDash(&dashPattern, &dashLength, &dashStart); - if (dashLength > 20) { - dashLength = 20; - } + + std::vector<SplashCoord> dash(dashLength); for (i = 0; i < dashLength; ++i) { dash[i] = (SplashCoord)dashPattern[i]; if (dash[i] < 0) { dash[i] = 0; } } - splash->setLineDash(dash, dashLength, (SplashCoord)dashStart); + splash->setLineDash(dash.data(), dashLength, (SplashCoord)dashStart); } void SplashOutputDev::updateFlatness(GfxState *state) |