summaryrefslogtreecommitdiff
path: root/splash
AgeCommit message (Collapse)AuthorFilesLines
2020-09-05Update (C)Albert Astals Cid1-1/+1
2020-09-05addStrokeAdjustHint(): fix crash in out-of-memory situation.Albert Astals Cid2-3/+11
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25411 #0 0xf7ef8f19 in [vdso] #1 0xf7ccdd08 in gsignal (/lib32/libc.so.6+0x2bd08) #2 0xf7ccf206 in abort (/lib32/libc.so.6+0x2d206) #3 0xbdb9c2e in grealloc(void*, unsigned int, bool) gdal/poppler/goo/gmem.h:85:5 #4 0xbdd9e11 in greallocn(void*, int, int, bool, bool) gdal/poppler/goo/gmem.h:171:12 #5 0xc012373 in SplashPath::addStrokeAdjustHint(int, int, int, int) gdal/poppler/splash/SplashPath.cc:211:35 #6 0xbfd156f in Splash::makeStrokePath(SplashPath*, double, bool) gdal/poppler/splash/Splash.cc:5987:34 #7 0xbfcaec2 in Splash::strokeWide(SplashPath*, double) gdal/poppler/splash/Splash.cc:2028:13 #8 0xbfc8a4d in Splash::stroke(SplashPath*) /src/gdal/poppler/splash/Splash.cc Based on patch by Even Rouault
2020-09-04Update (C)Albert Astals Cid1-0/+1
2020-09-02Splash: Rename Yd to Ydown, Xu to Xup, etc.Tobias Deiminger2-34/+34
Minor gift to new contributors. Makes methods intention more obvious.
2020-08-30Update (C)Albert Astals Cid1-0/+1
2020-08-29Splash bilinear scaling: Don't try read behind endTobias Deimigner1-1/+1
Source line iteration in Splash::scaleImageYuXuBilinear already tries to prevent a read behind source image end, as the comment indicates it and as it's conceptually reasonable. But the check for (currentSrcRow < srcHeight) is wrong and doesn't do what it claims. currentSrcRow will only ever increase to srcHeight - 1 after scaledHeight iterations. Therefore the check always evaluates to true, and src() is aways called. Intention was to prevented the line fetch for the last run and leave line2 identical to line1 (the "extra padding"). Nothing bad happened, because SplashOutputDev::imageSrc and alphaImageSrc gracefully handle the behind-end read. Should be corrected either.
2020-07-20Fix x86 + windows asmJean Ghali1-9/+31
It broke during the clang-reformat
2020-07-18Update (C)Albert Astals Cid1-0/+1
2020-07-17Splash: Set initial line width to 1Peter Wang1-2/+2
Fixes #674 The initial value of the line width graphics state parameter in PDF is 1.0.
2020-07-03Run clang-formatAlbert Astals Cid36-10612/+10146
find . \( -name "*.cpp" -or -name "*.h" -or -name "*.c" -or -name "*.cc" \) -exec clang-format -i {} \; If you reached this file doing a git blame, please see README.contributors (instructions added 2 commits in the future to this one)
2020-04-21[splash, arthur] Use stroking opacity when clipping to a stroke pathOliver Sander2-4/+10
When filling a region that is clipped to a stroke path, then the stroking opacity shall be used rather than the fill opacity. I couldn't find this in the spec, but it seems to be what Acrobat does. BUG: https://gitlab.freedesktop.org/poppler/poppler/-/issues/178
2020-03-19Some more constAlbert Astals Cid3-9/+9
2020-02-28Update (C) of last commitAlbert Astals Cid2-2/+2
2020-02-27Implement Splash::gouraudTriangleShadedFill for non parametrized shadingsAlbert Astals Cid3-74/+211
Fixes #881 Unfortunately only implemented for shadings where the 3 vertices of the triangle have the same color for now since i got lost trying to implement the coloring (and also have no pdf to check against) The reason this fixes #881 is because if Splash::gouraudTriangleShadedFill returns false because it doesn't natively support this shading, the default rendering algorithm of Gfx.cc kicks in, and that rendering what does is render different triangles without them knowing they belong to the same shading, meaning that if you have some opacity the edges of the triangles will overlap and and up having different color than the one you really wanted
2020-01-07More static -> static constAlbert Astals Cid1-3/+3
2019-12-21Splash::scaleImageYdXu: Protect against crash if srcWidth is too bigAlbert Astals Cid1-1/+5
oss-fuzz/19630
2019-12-19Splash: remove modified region book-keepingAlbert Astals Cid2-92/+0
Noone uses it so it's a bit faster not to do it
2019-12-03Add some more constAlbert Astals Cid1-1/+1
2019-12-03Enable modernize-loop-convertAlbert Astals Cid3-14/+17
2019-12-02Enable modernize-use-overrideAlbert Astals Cid3-3/+3
not claiming copyright for this since it's a mechanical change
2019-11-29Enable modernize-deprecated-headersAlbert Astals Cid16-29/+29
2019-11-29Enable readability-inconsistent-declaration-parameter-nameAlbert Astals Cid3-5/+6
2019-10-07Update (C) of previous commitAlbert Astals Cid2-0/+2
2019-10-07Move the non-trivial part of the clip test to the implementation fileStefan Brüns2-18/+18
This allows to only have a SplashXPathScanner forward declaration in the header file.
2019-10-07Include SplashMath.h only where neededStefan Brüns2-1/+1
2019-10-02Enable clang-tidy bugprone-too-small-loop-variableAlbert Astals Cid1-3/+3
And fixes for it in the code
2019-09-30Run clang-tidy on CIAlbert Astals Cid2-4/+4
Only with the performance- checks enabled for now
2019-09-27Update (C) of previous commitAlbert Astals Cid4-4/+4
2019-09-27Add some constAlbert Astals Cid5-9/+10
Suggested by clang-tidy readability-non-const-parameter check
2019-09-01SplashBitmap: Fix wrong width condition for splashModeDeviceN8Albert Astals Cid1-3/+3
2019-08-24Always enable SPLASH_CMYKAlbert Astals Cid7-141/+11
Doesn't seem to cause any speed regression and one ifdef less is code easier to maintain
2019-08-20Remove USE_FIXEDPOINT supportAdrian Bunk5-172/+7
This was already non-compiling for some time. Closes #821
2019-07-21SplashXPathScanner: Optionally use small_vector from boostStefan Brüns2-0/+16
Currently, each row in the intersections vector is allocated separately, when the first intersection is added. To avoid these allocations for common simple polygons, boost::container::small_vector<4, T> is used, which stores up to 4 intersections inline. small_vector is a header-only class. For the documents from #57 (fdo#96728) and #24 (fdo#78728), the runtime/memory is significantly reduced (according to /usr/bin/time -v): (1) $> pdftoppm -r 18 -aa no runsforever-poppler.pdf (2) $> pdftoppm surf-types.pdf Before/After runsforever-poppler | surf-types User time (seconds): 2348.08 / 1773.53 | 7.76 / 5.02 Maximum resident set size (kbytes): 46288 / 45896 | 14076 / 13748
2019-06-27Convert all files to UTF-8Daniel Schaefer3-3/+3
They were ISO-8859 before.
2019-06-21Splash: Rename local variable to fix shadow warningAlbert Astals Cid1-6/+6
2019-06-05adjustLine -> doAdjustLineAlbert Astals Cid1-3/+3
fixes shadow warning
2019-06-05Splash::makeDashedPath: Remove i declaration in forAlbert Astals Cid1-2/+2
We already have one above and this causes a shadow warning
2019-05-14Update (C) of previous commitAlbert Astals Cid1-0/+1
2019-05-13Splash: Restrict filling of overlapping boxesMarek Kasik1-15/+33
Check whether area to fill in Splash::blitTransparent() does not run out of allocated memory for source and for destination and shrink it if needed. Fixes #750
2019-04-22Add (C) for previous commitAlbert Astals Cid1-1/+1
2019-04-22Fix compile with SPLASH_CMYK enabledWilliam Bader1-9/+9
2019-04-03Update (C) of previous commitAlbert Astals Cid1-1/+1
2019-04-03SplashXPathScanner::clipAALine: Fix crash on broken fileAlbert Astals Cid1-1/+4
Make sure the index of allIntersections we access is valid Fixes #748
2019-03-21Update (C) from last commitAlbert Astals Cid3-0/+3
2019-03-21Remove GooList completelyOliver Sander3-7/+5
2019-03-21Remove method GooList::getOliver Sander2-2/+2
Use operator[] instead. This is another move towards discarding GooList in favor of std::vector.
2019-03-21Remove method deleteGooListOliver Sander1-1/+4
2019-03-21Make GooList a template typeOliver Sander3-8/+8
One more step towards getting rid of it completely.
2019-03-21Remove method GooList::getLengthOliver Sander2-3/+3
Use method 'size' (from std::vector) instead.
2019-02-03SplashXPath: Handle overflow of adjusts gracefullyAlbert Astals Cid1-59/+61
oss-fuzz/12638