mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
src/driver/volume.cpp:-fix segfault on new fb_pixel_t with not initialized digit_h+digit_offset
This commit is contained in:
@@ -63,6 +63,8 @@ CVolume::CVolume()
|
|||||||
m_mode = CNeutrinoApp::getInstance()->getMode();
|
m_mode = CNeutrinoApp::getInstance()->getMode();
|
||||||
channel_id = 0;
|
channel_id = 0;
|
||||||
apid = 0;
|
apid = 0;
|
||||||
|
digit_h = 0;
|
||||||
|
digit_offset = 0;
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@@ -92,16 +94,18 @@ void CVolume::Init()
|
|||||||
y = sy = frameBuffer->getScreenY() + spacer / 2;
|
y = sy = frameBuffer->getScreenY() + spacer / 2;
|
||||||
sw = g_settings.screen_EndX - spacer;
|
sw = g_settings.screen_EndX - spacer;
|
||||||
sh = frameBuffer->getScreenHeight();
|
sh = frameBuffer->getScreenHeight();
|
||||||
|
icon_w = icon_h = 0;
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_w, &icon_h);
|
frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_w, &icon_h);
|
||||||
|
if (paintDigits) {
|
||||||
|
digit_offset = g_Font[VolumeFont]->getDigitOffset();
|
||||||
|
digit_h = g_Font[VolumeFont]->getDigitHeight();
|
||||||
|
}
|
||||||
vbar_h = std::max((icon_h * faktor_h) / 10, digit_h + digit_offset);
|
vbar_h = std::max((icon_h * faktor_h) / 10, digit_h + digit_offset);
|
||||||
progress_h = icon_h - 2*pB;
|
progress_h = icon_h - 2*pB;
|
||||||
progress_w = 200;
|
progress_w = 200;
|
||||||
vbar_w = spacer + icon_w + spacer + progress_w + spacer;
|
vbar_w = spacer + icon_w + spacer + progress_w + spacer;
|
||||||
if (paintDigits) {
|
if (paintDigits) {
|
||||||
digit_w = g_Font[VolumeFont]->getRenderWidth("100");
|
digit_w = g_Font[VolumeFont]->getRenderWidth("100");
|
||||||
digit_offset = g_Font[VolumeFont]->getDigitOffset();
|
|
||||||
digit_h = g_Font[VolumeFont]->getDigitHeight();
|
|
||||||
progress_h = std::max(icon_h, digit_h) - 2*pB;
|
progress_h = std::max(icon_h, digit_h) - 2*pB;
|
||||||
vbar_w += digit_w;
|
vbar_w += digit_w;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user