splash/Splash.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 274626018dc7693cb98f8e2538c44b19bc9b7c11 Author: Albert Astals Cid <[email protected]> Date: Thu Dec 2 20:08:58 2021 +0100 Fix crash in Splash::gouraudTriangleShadedFill When bDirectBlit is true and the three triangle vertices don't have the same color we don't have to delete blitTarget Fixes issue #1183 diff --git a/splash/Splash.cc b/splash/Splash.cc index d2c7b75f..0119cfe0 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -5468,7 +5468,9 @@ bool Splash::gouraudTriangleShadedFill(SplashGouraudColor *shading) // Sadly this current algorithm only supports shadings where the three triangle vertices have the same color shading->getNonParametrizedTriangle(i, bitmapMode, xdbl + 0, ydbl + 0, (SplashColorPtr)&color, xdbl + 1, ydbl + 1, (SplashColorPtr)&auxColor1, xdbl + 2, ydbl + 2, (SplashColorPtr)&auxColor2); if (!splashColorEqual(color, auxColor1) || !splashColorEqual(color, auxColor2)) { - delete blitTarget; + if (!bDirectBlit) { + delete blitTarget; + } return false; } for (int m = 0; m < 3; ++m) {
