From 323894ba1203e9c230a5f05fa7b0cfafc71eb05d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Dec 2016 12:14:21 +0100 Subject: [PATCH 1/5] src/zapit/src/fastscan.cpp avoid out of bounds Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/853c0d1b6835d132bd774335969d5e76d2073fde Author: Jacek Jendrzej Date: 2016-12-29 (Thu, 29 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/fastscan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 96e5ed532..956d294e2 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -293,7 +293,7 @@ _err: bool CServiceScan::ReadFstVersion(int num) { - if(num >= OPERATOR_MAX) { + if(num >= OPERATOR_MAX || num < 0) { printf("[fast scan] invalid operator %d\n", num); return false; } From a71c48a9dbdc6c3b30fa0a98b050ea517f5cdc91 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Dec 2016 16:18:13 +0100 Subject: [PATCH 2/5] src/timerd/timermanager.cpp fix double locking Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e88eeb61cddd507936bf58646a61bd2b5f4a5474 Author: Jacek Jendrzej Date: 2016-12-29 (Thu, 29 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 4d3dddf78..e18e1612f 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -819,7 +819,9 @@ void CTimerManager::cancelShutdownOnWakeup() { pthread_mutex_lock(&tm_eventsMutex); if (shutdown_eventID > -1) { + pthread_mutex_unlock(&tm_eventsMutex); removeEvent(shutdown_eventID); + pthread_mutex_lock(&tm_eventsMutex); shutdown_eventID = -1; } wakeup = 0; From c3adf029ac8386ab748f66752cf2f6ed9eb5c435 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Dec 2016 18:41:25 +0100 Subject: [PATCH 3/5] some dead assignment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0ed24632b74d8ef0c56802ad9b832ed98cb928d7 Author: Jacek Jendrzej Date: 2016-12-29 (Thu, 29 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 1 - src/neutrino.cpp | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 74dc5a3ee..a4d56cb47 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1981,7 +1981,6 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (frameBuffer->paintIcon(record_icon, icon_x_right - icon_w, ypos, fheight)) { offset_right += icon_w + OFFSET_INNER_MID; - icon_x_right -= icon_w + OFFSET_INNER_MID; } } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e08949eb9..24cb19c2f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1497,9 +1497,6 @@ void CNeutrinoApp::channelsInit(bool bOnly) RADIObouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); RADIOfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); - uint32_t i; - i = 1; - int tvi = 0, ri = 0; ZapitChannelList zapitList, webtvList; @@ -1627,7 +1624,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) /* Favorites and providers bouquets */ tvi = ri = 0; if(g_bouquetManager){ - for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { + for (uint32_t i = 0; i < g_bouquetManager->Bouquets.size(); i++) { CZapitBouquet *b = g_bouquetManager->Bouquets[i]; if (!b->bHidden) { if (b->getTvChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { @@ -2033,7 +2030,7 @@ TIMER_START(); if (loadLocale_ret == CLocaleManager::NO_SUCH_LOCALE) { g_settings.language = "english"; - loadLocale_ret = g_Locale->loadLocale(g_settings.language.c_str()); + g_Locale->loadLocale(g_settings.language.c_str()); show_startwizard = true; } @@ -2772,7 +2769,7 @@ void CNeutrinoApp::zapTo(t_channel_id channel_id) { bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(channel_id); if (!recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || - (recordingStatus && channelList->SameTP(channel_id))) { + (recordingStatus && channelList && channelList->SameTP(channel_id))) { dvbsub_stop(); g_Zapit->zapTo_serviceID_NOWAIT(channel_id); @@ -2807,7 +2804,8 @@ void CNeutrinoApp::standbyToStandby(void) t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); if (standby_channel_id && (live_channel_id != standby_channel_id)) { live_channel_id = standby_channel_id; - channelList->zapTo_ChannelID(live_channel_id); + if(channelList) + channelList->zapTo_ChannelID(live_channel_id); } g_Zapit->setStandby(true); g_Sectionsd->setPauseScanning(true); @@ -3221,7 +3219,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || - (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { + (recordingstatus && channelList && channelList->SameTP(eventinfo->channel_id)) ) { bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); dvbsub_stop(); @@ -3232,7 +3230,9 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if (isTVMode && (mode != mode_tv) && (mode != mode_webtv)) { tvMode(true); } - channelList->zapTo_ChannelID(eventinfo->channel_id); + + if(channelList) + channelList->zapTo_ChannelID(eventinfo->channel_id); } } delete[] (unsigned char*) data; @@ -4762,7 +4762,7 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) if(!has_channel && old_mode == LIST_MODE_SAT) new_mode = LIST_MODE_ALL; - has_channel = TVallList->adjustToChannelID(channel_id); + TVallList->adjustToChannelID(channel_id); } else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) { has_channel = RADIOfavList->adjustToChannelID(channel_id); @@ -4789,7 +4789,7 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) if(!has_channel && old_mode == LIST_MODE_SAT) new_mode = LIST_MODE_ALL; - has_channel = RADIOallList->adjustToChannelID(channel_id); + RADIOallList->adjustToChannelID(channel_id); } if(old_mode != new_mode) CNeutrinoApp::getInstance()->SetChannelMode(new_mode); From db5ba19db59ef739815153953502b1f007f24de0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Dec 2016 18:51:06 +0100 Subject: [PATCH 4/5] some dead assignment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c0564ec574cc3cbb888f83e9a590b364fb31ff47 Author: Jacek Jendrzej Date: 2016-12-29 (Thu, 29 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index a3e26b90e..f4f10ba20 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -231,11 +231,10 @@ void CComponentsHeader::initIcon() cch_icon_obj->doPaintBg(false); //set corner mode of icon item - int cc_icon_corner_type = corner_type; + int cc_icon_corner_type = CORNER_LEFT; if (corner_type == CORNER_TOP_LEFT || corner_type == CORNER_TOP) cc_icon_corner_type = CORNER_TOP_LEFT; - else - cc_icon_corner_type = CORNER_LEFT; + cch_icon_obj->setCorner(corner_rad-fr_thickness, cc_icon_corner_type); //global set width of icon object @@ -335,11 +334,10 @@ void CComponentsHeader::initButtons() cch_btn_obj->addIcon(v_cch_btn); //set corner mode of button item - int cc_btn_corner_type = corner_type; + int cc_btn_corner_type = CORNER_RIGHT; if (corner_type == CORNER_TOP_RIGHT || corner_type == CORNER_TOP) cc_btn_corner_type = CORNER_TOP_RIGHT; - else - cc_btn_corner_type = CORNER_RIGHT; + cch_btn_obj->setCorner(corner_rad-fr_thickness, cc_btn_corner_type); //global adapt height @@ -412,11 +410,10 @@ void CComponentsHeader::initClock() cch_cl_obj->setClockFormat(cch_cl_format, cch_cl_sec_format); //set corner mode of button item - int cc_btn_corner_type = corner_type; + int cc_btn_corner_type = CORNER_RIGHT; if (corner_type == CORNER_TOP_RIGHT || corner_type == CORNER_TOP) cc_btn_corner_type = CORNER_TOP_RIGHT; - else - cc_btn_corner_type = CORNER_RIGHT; + cch_cl_obj->setCorner(corner_rad-fr_thickness, cc_btn_corner_type); //global adapt height From 3306c94002df860dcbdd8a32f23f95b63c514b8e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 30 Dec 2016 08:22:24 +0100 Subject: [PATCH 5/5] streaminfo2: just code cosmetics; no binary changes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/db06238cd561c53230b3d3b049f3c7d99fec79f1 Author: vanhofen Date: 2016-12-30 (Fri, 30 Dec 2016) Origin message was: ------------------ - streaminfo2: just code cosmetics; no binary changes ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/streaminfo2.cpp | 58 +++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index f6b7fb0d6..7d9d6e93c 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -626,20 +626,43 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); - if(type == AUDIO_FMT_MPEG) { - const int max_mode = 4; - const char *mpegmodes[max_mode] = { "stereo", "joint_st", "dual_ch", "single_ch" }; - snprintf(buf, sizeof(buf), "MPEG %s (%d)", (mode > max_mode) ?"unk":mpegmodes[mode], freq); - } else if (type == AUDIO_FMT_DOLBY_DIGITAL || type == AUDIO_FMT_DD_PLUS) { - const int max_mode = 8; - const char *ddmodes[max_mode] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" }; + if (type == AUDIO_FMT_MPEG) + { + const char *mpegmodes[] = + { + "stereo", + "joint_st", + "dual_ch", + "single_ch" + }; + int max_mode = sizeof(mpegmodes) / sizeof(mpegmodes[0]); + snprintf(buf, sizeof(buf), "MPEG %s (%d)", + (mode > max_mode) ? "unk" : mpegmodes[mode], + freq); + } + else if (type == AUDIO_FMT_DOLBY_DIGITAL || type == AUDIO_FMT_DD_PLUS) + { + const char *ddmodes[] = + { + "CH1/CH2", + "C", + "L/R", + "L/C/R", + "L/R/S", + "L/C/R/S", + "L/R/SL/SR", + "L/C/R/SL/SR" + }; + int max_mode = sizeof(ddmodes) / sizeof(ddmodes[0]); snprintf(buf, sizeof(buf), "%s %s (%d)", (type == AUDIO_FMT_DOLBY_DIGITAL) ? "DD" : "DD+", - (mode > max_mode) ?"unk": ddmodes[mode], + (mode > max_mode) ? "unk" : ddmodes[mode], freq); - } else if (type == AUDIO_FMT_AAC || type == AUDIO_FMT_AAC_PLUS) { - const int max_mode = 10; - const char *aacmodes[max_mode] = { + } + else if (type == AUDIO_FMT_AAC || type == AUDIO_FMT_AAC_PLUS) + { + const char *aacmodes[] = + { "N/S", "Mono", "L/R", @@ -651,11 +674,17 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) "L/R/SL/SR", "Dual-Mono" }; + int max_mode = sizeof(aacmodes) / sizeof(aacmodes[0]); snprintf(buf, sizeof(buf), "%s %s (%d)", (type == AUDIO_FMT_AAC) ? "AAC" : "AAC+", - (mode > max_mode) ?"unk":aacmodes[mode], freq); - } else { - snprintf(buf, sizeof(buf), "%s (%d)", g_Locale->getText(LOCALE_STREAMINFO_AUDIOTYPE_UNKNOWN), freq); + (mode > max_mode) ? "unk" : aacmodes[mode], + freq); + } + else + { + snprintf(buf, sizeof(buf), "%s (%d)", + g_Locale->getText(LOCALE_STREAMINFO_AUDIOTYPE_UNKNOWN), + freq); } g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); @@ -717,6 +746,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) int fontW = g_Font[font_small]->getWidth(); spaceoffset = 7 * fontW; box_width2 = box_width-(spaceoffset+xpos); + //onid ypos+= sheight; snprintf(buf, sizeof(buf), "0x%04X (%i)", channel->getOriginalNetworkId(), channel->getOriginalNetworkId());