From cc3f3cf43c274b28f0688533b34d781ca1627516 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 1 Nov 2016 14:50:08 +0100 Subject: [PATCH 1/9] pictureviewer: fix possible segfault if width or height < 1,fix possible memleak Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5ea4cbf1453c636cdae08b63e95d940e59a41550 Author: Jacek Jendrzej Date: 2016-11-01 (Tue, 01 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 7c81ef2ed..c658cea04 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -616,6 +616,11 @@ void CPictureViewer::rescaleImageDimensions(int *width, int *height, const int m bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, int transp) { + if(width < 1 || height < 1){ + dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: width %i height %i \n", __func__, __LINE__, width, height); + return false; + } + CFrameBuffer* frameBuffer = CFrameBuffer::getInstance(); if (transp > CFrameBuffer::TM_EMPTY) frameBuffer->SetTransparent(transp); @@ -672,6 +677,12 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width, if (load_ret == FH_ERROR_OK) { dprintf(DEBUG_INFO, "[CPictureViewer] [%s - %d] mode %s, decoded %s, (Pos: %d %d) ,bpp = %d \n", __func__, __LINE__, mode_str.c_str(), name.c_str(), x, y, bpp); + // image size error + if((GetImage) && (*width < 1 || *height < 1)){ + dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] mode: %s, file: %s (Pos: %d %d, Dim: %d x %d)\n", __func__, __LINE__, mode_str.c_str(), name.c_str(), x, y, *width, *height); + free(buffer); + return NULL; + } // resize only getImage if ((GetImage) && (x != *width || y != *height)) { @@ -691,6 +702,7 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width, *height = y; }else{ dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] mode %s: Error decoding file %s\n", __func__, __LINE__, mode_str.c_str(), name.c_str()); + free(buffer); return NULL; } free(buffer); From 4dbb29ed12b44d9e0d01eac83c8efdf2dd450a5e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 1 Nov 2016 22:20:26 +0100 Subject: [PATCH 2/9] miscsettings_menu: fix youtube api key length Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/da14d72dcbe7dc45278a97acfe1788d774f14894 Author: vanhofen Date: 2016-11-01 (Tue, 01 Nov 2016) Origin message was: ------------------ - miscsettings_menu: fix youtube api key length ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/miscsettings_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index b76adc465..378942b72 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -569,7 +569,7 @@ int CMiscMenue::showMiscSettingsMenuOnlineServices() ms_oservices->addItem(youtube_onoff); changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL); - CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 38, this); + CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 39, this); mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID); ms_oservices->addItem(mf); From 3a2876ce226940814e4e290f2000806e9b624317 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 12:17:11 +0100 Subject: [PATCH 3/9] src/gui/widget/textbox.cpp try to fix text lines per page Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6c4324f6c91cd8f8eaaf10b3d7695882f93a18d Author: Jacek Jendrzej Date: 2016-11-03 (Thu, 03 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 7120b7a16..5651d302c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -311,6 +311,8 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + m_nLinesPerPage += 1; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tScroll:\t%3d,%3d,%3d,%3d \r\n", @@ -466,6 +468,8 @@ void CTextBox::refreshTextLineArray(void) } m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; if(m_nCurrentPage >= m_nNrOfPages) From be4173bff6d03d050c1ab86f7742bcaa06b9e454 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 12:51:31 +0100 Subject: [PATCH 4/9] src/gui/widget/textbox.cpp supplement to try to fix text lines per page Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e26ad6e9f1970d82d5a2b80315acf67b526c228e Author: Jacek Jendrzej Date: 2016-11-03 (Thu, 03 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 5651d302c..428063a4f 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -310,8 +310,9 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; - m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); - if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + int lines_per_page_tmp = (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight; + m_nLinesPerPage = std::max(1,lines_per_page_tmp); + if(lines_per_page_tmp && (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) m_nLinesPerPage += 1; #if 0 @@ -467,8 +468,9 @@ void CTextBox::refreshTextLineArray(void) reSizeMainFrameHeight(m_nNrOfLines * m_nFontTextHeight); } - m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); - if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + int lines_per_page_tmp = (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight; + m_nLinesPerPage = std::max(1, lines_per_page_tmp); + if(lines_per_page_tmp && (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; From 3e32c17062e1833b86f4e610d2af203c59ae2f49 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 18:38:14 +0100 Subject: [PATCH 5/9] Revert "src/gui/widget/textbox.cpp supplement to try to fix text lines per page" This reverts commit be4173bff6d03d050c1ab86f7742bcaa06b9e454. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3815694e391025ae44ff21f75d5942cd83a796e5 Author: Jacek Jendrzej Date: 2016-11-03 (Thu, 03 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 428063a4f..5651d302c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -310,9 +310,8 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; - int lines_per_page_tmp = (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight; - m_nLinesPerPage = std::max(1,lines_per_page_tmp); - if(lines_per_page_tmp && (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) m_nLinesPerPage += 1; #if 0 @@ -468,9 +467,8 @@ void CTextBox::refreshTextLineArray(void) reSizeMainFrameHeight(m_nNrOfLines * m_nFontTextHeight); } - int lines_per_page_tmp = (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight; - m_nLinesPerPage = std::max(1, lines_per_page_tmp); - if(lines_per_page_tmp && (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; From d806d6ae7d8d15b0af24d4124f3f2eee2decb372 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 18:38:41 +0100 Subject: [PATCH 6/9] Revert "src/gui/widget/textbox.cpp try to fix text lines per page" This reverts commit 3a2876ce226940814e4e290f2000806e9b624317. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2907aa5a37ebe4aaeb287101ce8e3a5c3fcb7bbc Author: Jacek Jendrzej Date: 2016-11-03 (Thu, 03 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 5651d302c..7120b7a16 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -311,8 +311,6 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); - if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) - m_nLinesPerPage += 1; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tScroll:\t%3d,%3d,%3d,%3d \r\n", @@ -468,8 +466,6 @@ void CTextBox::refreshTextLineArray(void) } m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); - if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) - m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; if(m_nCurrentPage >= m_nNrOfPages) From 15a345b48459f55495ae78b4952e0771a426ab36 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 4 Nov 2016 16:46:47 +0100 Subject: [PATCH 7/9] cablex.xml: update Unitymedia; thx to klauser Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf987b74781d97db34448cd60556e50827ec20da Author: vanhofen Date: 2016-11-04 (Fri, 04 Nov 2016) Origin message was: ------------------ - cablex.xml: update Unitymedia; thx to klauser ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/cables.xml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/data/cables.xml b/data/cables.xml index debbe767f..4970d600c 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -220,11 +220,10 @@ - - - - - + + + + @@ -245,32 +244,27 @@ + + + + - - - - - - - - - - - - - - + + - + + + + From c782bff2b40f65a8b527585708e2e88faeb032df Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Nov 2016 23:56:29 +0100 Subject: [PATCH 8/9] CComponentsInfoBox: fix missing calculation of image position with parent Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/90a693a1ec9f588d7d42362e4b393574e2682a13 Author: Thilo Graf Date: 2016-11-04 (Fri, 04 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_infobox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 4d3f785e9..a2a6b6cbb 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -105,8 +105,12 @@ void CComponentsInfoBox::paintPicture() if (pic_name.empty()) return; + //NOTE: real values are reqiured, if we paint this item within a form as embedded cc-item + int x_pic = (cc_parent ? cc_xr : x) + fr_thickness; + int y_pic = (cc_parent ? cc_yr : y) + fr_thickness; + //init pic object and set icon paint position - pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness, 0, min(48, height-2*fr_thickness), pic_name); //NOTE: icons do not scale! + pic = new CComponentsPicture(x_pic+x_offset, y_pic, 0, min(48, height-2*fr_thickness), pic_name); //NOTE: icons do not scale! pic->setColorBody(col_body); @@ -115,7 +119,7 @@ void CComponentsInfoBox::paintPicture() pic->doPaintBg(false); //fit icon into frame - pic->setYPos(y+(height/2-pic->getHeight()/2)); + pic->setYPos(y_pic+(height/2-pic->getHeight()/2)); //paint, but set visibility mode pic->allowPaint(cc_allow_paint); From 0e3c24452fe2b27100ab6d48e27f2f76510a40cb Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 5 Nov 2016 21:07:12 +0100 Subject: [PATCH 9/9] timermanager: try to fix successive timers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7c74d0bc3b7bb4a5940f2cb3351604982fc4ce75 Author: vanhofen Date: 2016-11-05 (Sat, 05 Nov 2016) Origin message was: ------------------ - timermanager: try to fix successive timers ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index d9a54e36a..cfb509c8e 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1306,10 +1306,19 @@ bool CTimerEvent_Record::adjustToCurrentEPG() CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); time_t now = time(NULL); + time_t compare; + + int pre, post; + CTimerManager::getInstance()->getRecordingSafety(pre, post); + CChannelEventList::iterator first = evtlist.end(); for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) { - if (e->startTime < now) + compare = e->startTime; + if (!pre) + compare += e->duration; + + if (compare <= now) continue; if (first == evtlist.end() || first->startTime > e->startTime) first = e; @@ -1323,8 +1332,6 @@ bool CTimerEvent_Record::adjustToCurrentEPG() time_t _alarmTime = first->startTime; time_t _stopTime = first->startTime + first->duration; if (recordingSafety) { - int pre, post; - CTimerManager::getInstance()->getRecordingSafety(pre, post); _alarmTime -= pre; _stopTime += post; }