mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
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: 6f10282611
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-02-12 (Fri, 12 Feb 2010)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user