From 4b25ad6951148a62c95290d1574751980d3926ba Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 30 Oct 2016 01:34:41 +0200 Subject: [PATCH 1/6] - yWeb: change info string to Tuxbox-Neutrino --- src/nhttpd/web/Y_Version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 89d2ca789..cdf6bc930 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ version=2.9.0.39 date=26.08.2016 type=Release -info=Port CST +info=Port Tuxbox-Neutrino From 5804ed2d3a444021c8f990964b7c0e233192bc4c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 30 Oct 2016 01:34:41 +0200 Subject: [PATCH 2/6] - yWeb: fix url to Y_Version.txt --- src/nhttpd/web/scripts/Y_Tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/web/scripts/Y_Tools.sh b/src/nhttpd/web/scripts/Y_Tools.sh index a65ecf490..5c1d6bf38 100755 --- a/src/nhttpd/web/scripts/Y_Tools.sh +++ b/src/nhttpd/web/scripts/Y_Tools.sh @@ -581,7 +581,7 @@ case "$1" in fbshot) shift 1; do_fbshot $* ;; fbshot_clear) do_fbshot_clear ;; screenshot_clear) do_screenshot_clear ;; - get_update_version) wget -O /tmp/version.txt "http://git.coolstreamtech.de/?p=cst-public-gui-neutrino.git;a=blob_plain;f=src/nhttpd/web/Y_Version.txt;hb=refs/heads/cst-next" ;; + get_update_version) wget -O /tmp/version.txt "http://raw.github.com/tuxbox-neutrino/gui-neutrino/master/src/nhttpd/web/Y_Version.txt" ;; settings_backup_restore) shift 1; do_settings_backup_restore $* ;; exec_cmd) shift 1; $* ;; automount_list) shift 1; do_automount_list $* ;; From b8849d53b5d80aabf868e5b8f79c6aec257b7177 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 31 Oct 2016 15:53:29 +0100 Subject: [PATCH 3/6] fix possible segfault and negative height --- src/driver/colorgradient.cpp | 5 +++++ src/driver/framebuffer.cpp | 5 ++++- src/gui/components/cc_frm_scrollbar.cpp | 4 ++++ src/gui/infoviewer.cpp | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/driver/colorgradient.cpp b/src/driver/colorgradient.cpp index ee8e91150..e41087365 100644 --- a/src/driver/colorgradient.cpp +++ b/src/driver/colorgradient.cpp @@ -62,6 +62,9 @@ uint8_t CColorGradient::limitChar(int c) fb_pixel_t* CColorGradient::gradientColorToTransparent(fb_pixel_t col, fb_pixel_t *gradientBuf, int bSize, int /*mode*/, int /*intensity*/) { + if (bSize < 1) + return gradientBuf; + if (gradientBuf == NULL) { gradientBuf = (fb_pixel_t*) malloc(bSize * sizeof(fb_pixel_t)); if (gradientBuf == NULL) { @@ -94,6 +97,8 @@ fb_pixel_t* CColorGradient::gradientColorToTransparent(fb_pixel_t col, fb_pixel_ fb_pixel_t* CColorGradient::gradientOneColor(fb_pixel_t col, fb_pixel_t *gradientBuf, int bSize, int mode, int intensity, uint8_t v_min, uint8_t v_max, uint8_t s) { + if (bSize < 1) + return gradientBuf; if (gradientBuf == NULL) { gradientBuf = (fb_pixel_t*) malloc(bSize * sizeof(fb_pixel_t)); diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 526e27371..aba573365 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -676,7 +676,7 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const int { if (!getActive()) return buf; - if (dx == 0 || dy == 0) { + if (dx < 1 || dy < 1) { dprintf(DEBUG_INFO, "[CFrameBuffer] [%s - %d]: radius %d, dx %d dy %d\n", __func__, __LINE__, radius, dx, dy); return buf; } @@ -2026,6 +2026,9 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff) { + if(width <1 || height <1 || !boxBuf ) + return; + uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 953892245..e64607553 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -136,6 +136,8 @@ void CComponentsScrollBar::initSegments() //calculate height of segment container int h_seg_obj = height - 2*sb_up_obj->getHeight() - 3*append_y_offset; + if(h_seg_obj < 0) + h_seg_obj = 0; //init segment container if (sb_segments_obj == NULL){ @@ -154,6 +156,8 @@ void CComponentsScrollBar::initSegments() //set y position of 1st segment and set height of segments int y_seg = 1+ append_y_offset; int h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; + if(h_seg < 0) + h_seg = 0; //create and add segments to segment container for(u_int8_t i=0; iinitBBOffset(); if (!zap_mode) h_body += infoViewerBB->bottom_bar_offset; From 6b640cfa7be22787e0ca367b5d5a47510a772b0c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 31 Oct 2016 18:23:17 +0100 Subject: [PATCH 4/6] src/gui/scan_setup.cpp fix preselected transponder item --- src/gui/scan_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 5ad95d794..a4aa2599b 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1963,7 +1963,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) if(channel) CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), ct); - int i = 0; + int i = menu.getItemsCount(); transponder_list_t &select_transponders = CServiceManager::getInstance()->GetSatelliteTransponders(position); for (transponder_list_t::iterator tI = select_transponders.begin(); tI != select_transponders.end(); ++tI) { sprintf(cnt, "%d", i); From 5ea4cbf1453c636cdae08b63e95d940e59a41550 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 1 Nov 2016 14:50:08 +0100 Subject: [PATCH 5/6] pictureviewer: fix possible segfault if width or height < 1,fix possible memleak --- 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 da14d72dcbe7dc45278a97acfe1788d774f14894 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 1 Nov 2016 22:20:26 +0100 Subject: [PATCH 6/6] - miscsettings_menu: fix youtube api key length --- 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);