From 1a39ec9d40b0def0f4f4c6fcd27fb718dc0ccc9c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 12 Feb 2010 18:02:33 +0000 Subject: [PATCH] Fix crash, if some of r/g/b is 0 git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@330 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f10282611dedeb388855b952389a0c40454063f Author: [CST] Focus Date: 2010-02-12 (Fri, 12 Feb 2010) ------------------ This commit was generated by Migit --- src/gui/widget/progressbar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/progressbar.cpp b/src/gui/widget/progressbar.cpp index 483695954..31df52b2c 100644 --- a/src/gui/widget/progressbar.cpp +++ b/src/gui/widget/progressbar.cpp @@ -196,8 +196,8 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, if (active_pb_width != last_width) { int step; if (active_pb_width > last_width) { - step = 255 / rd; for (i = 0; (i < rd) && (i < maxi); i++) { + step = 255 / rd; if (invert) rgb = GREEN + ((unsigned char)(step * i) << 16); // adding red else @@ -207,8 +207,8 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, frameBuffer->paintBoxRel(pos_x + i * ITEMW, pos_y + j * ITEMW, POINT, POINT, color); } - step = 255 / yw / 2; for (; (i < yw) && (i < maxi); i++) { + step = 255 / yw / 2; if (invert) rgb = YELLOW - ((unsigned char)(step * (b++)) << 8); // removing green else @@ -218,8 +218,8 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, frameBuffer->paintBoxRel(pos_x + i * ITEMW, pos_y + j * ITEMW, POINT, POINT, color); } - step = 255 / gn; for (; (i < gn) && (i < maxi); i++) { + step = 255 / gn; if (invert) rgb = YELLOW - ((unsigned char) (step * (b++)) << 8); // removing green else