From afe47b014a0538171e826c780f198a19df60bd69 Mon Sep 17 00:00:00 2001 From: lukaslw Date: Mon, 18 Aug 2014 22:03:50 +0200 Subject: PRINCE: drawTransparentWithTrans - memory leak fix --- engines/prince/graphics.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index d70591d2cc..2f021fe223 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -200,7 +200,11 @@ void GraphicsMan::drawTransparentWithTransDrawNode(Graphics::Surface *screen, Dr } } } - } else if (*(src2 + 1) == 255) { + } else if (x != drawNode->s->w - 1) { + if (*(src2 + 1) == 255) { + continue; + } + } else { continue; } byte value = 0; @@ -216,11 +220,13 @@ void GraphicsMan::drawTransparentWithTransDrawNode(Graphics::Surface *screen, Dr continue; } } - } else { + } else if (y) { value = *(src2 - drawNode->s->pitch); if (value == 255) { continue; } + } else { + continue; } *dst2 = transTableData[*dst2 * 256 + value]; } -- cgit v1.2.3