From 94284c2e5ba998bccb9dd5b20e88aa9c8e781583 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Dec 2018 21:41:19 +0100 Subject: [PATCH] cc_draw.cpp: call blitBox2FB() only if checkFbArea() was true This should prevent pass corrupted parameters for blitBox2FB(). --- src/gui/components/cc_draw.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 663fe52f3..cf5d0ba9c 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -672,10 +672,11 @@ void CCDraw::paintFbItems(bool do_save_bg) } }else{ // If found gradient buffer, paint box from gradient cache. - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); - frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); + if (frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true)){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); + } } }else{ /* If is nothihng cached or no background image was defined or image paint was failed,