From 8d1a669301e16544f42d7e88ffe2cef94a3d2261 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 29 Jun 2017 15:03:16 +0200 Subject: [PATCH 1/3] lib-libtuxtxt-tuxtxt.cpp avoid segfault, supplement to 6771de1 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6344b352790fe63bb4c84c2d4a5fc3ab5a05029 Author: Michael Liebmann Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d5d093a6a..102efd4c1 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -47,6 +47,9 @@ static int cfg_national_subset; static int screen_x, screen_y, screen_w, screen_h; +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor=false); +void FillBorder(fb_pixel_t color, bool modeFullColor=false); + fb_pixel_t *getFBp(int *y) { if (*y < (int)var_screeninfo.yres) @@ -56,34 +59,31 @@ fb_pixel_t *getFBp(int *y) return lbb; } -void FillRect(int x, int y, int w, int h, int color) +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor/*=false*/) { - if(color < 0 || SIZECOLTABLE < color){ - printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); - return; - } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; - if (w > 0) + if (w > 0) { + fb_pixel_t col = (modeFullColor) ? color : bgra[color]; for (int count = 0; count < h; count++) { fb_pixel_t *dest0 = p; for (int i = 0; i < w; i++) - *(dest0++) = bgra[color]; + *(dest0++) = col; p += stride; } + } } - -void FillBorder(int color) +void FillBorder(fb_pixel_t color, bool modeFullColor/*=false*/) { int ys = (var_screeninfo.yres-var_screeninfo.yoffset); - FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color); - FillRect(StartX, ys ,displaywidth,StartY ,color); - FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color); + FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color, modeFullColor); + FillRect(StartX, ys ,displaywidth,StartY ,color, modeFullColor); + FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color, modeFullColor); if (screenmode == 0 ) - FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color); + FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color, modeFullColor); } int getIndexOfPageInHotlist() @@ -258,7 +258,7 @@ void RenderClearMenuLineBB(char *p, tstPageAttr *attrcol, tstPageAttr *attr) memset(p-TOPMENUCHARS, ' ', TOPMENUCHARS); /* init with spaces */ } -void ClearBB(int color) +void ClearBB(fb_pixel_t color) { FillRect(0, (var_screeninfo.yres - var_screeninfo.yoffset), var_screeninfo.xres, var_screeninfo.yres, color); } @@ -270,7 +270,7 @@ void ClearFB(int /*color*/) } #if 0 //never used -void ClearB(int color) +void ClearB(fb_pixel_t color) { FillRect(0, 0, var_screeninfo.xres, var_screeninfo.yres, color); /* framebuffer */ FillRect(0, var_screeninfo.yres, var_screeninfo.xres, var_screeninfo.yres, color); /* backbuffer */ @@ -841,7 +841,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, { *pAPy = RowAddress2Row(iAddress); /* new Active Row */ - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0 + *pAPy; int maxrow; #if TUXTXT_DEBUG @@ -892,7 +892,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, *pAPx = *pAPy = 0; /* new Active Position 0,0 */ if (*endcol == 40) /* active object */ { - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0; // + *pAPy; int maxrow; @@ -4096,7 +4096,7 @@ void RenderDRCS( //FIX ME } -void DrawVLine(int x, int y, int l, int color) +void DrawVLine(int x, int y, int l, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, 0, l); @@ -4109,7 +4109,7 @@ void DrawVLine(int x, int y, int l, int color) } } -void DrawHLine(int x, int y, int l, int color) +void DrawHLine(int x, int y, int l, fb_pixel_t color) { int ltmp; fb_pixel_t *p = getFBp(&y); @@ -4130,7 +4130,7 @@ void FillRectMosaicSeparated(int x, int y, int w, int h, int fgcolor, int bgcolo } } -void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, int color) +void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y0); MARK_FB(x0, y0, l0, h); @@ -4789,7 +4789,7 @@ void RenderChar(int Char, tstPageAttr *Attribute, int zoom, int yoffset) { for (Bit = 0x80; Bit; Bit >>= 1) { - int color; + fb_pixel_t color; if (--pixtodo < 0) break; @@ -5559,7 +5559,7 @@ void CopyBB2FB() /* adapt background of backbuffer if changed */ if (StartX > 0 && *lfb != *lbb) { - FillBorder(*lbb); + FillBorder(*lbb, true); // ClearBB(*(lfb + var_screeninfo.xres * var_screeninfo.yoffset)); } From 82f30b454dc471e8f31ae3326dc656c834e251bf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 29 Jun 2017 17:18:06 +0200 Subject: [PATCH 2/3] settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a7ac6c0b0293660e2be11dc23439d76467b9296 Author: vanhofen Date: 2017-06-29 (Thu, 29 Jun 2017) Origin message was: ------------------ - settings.h: rename FRAME_MIN_WIDTH to FRAME_WIDTH_MIN ... to get same name-structure as in the existing defines (cherry picked from commit 88fc7e5ab10e81fa7638b0e434cb50f95690c2f4) Signed-off-by: Thilo Graf Conflicts: src/system/settings.h ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 2 +- src/system/settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 34e022b86..6596d959b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1722,7 +1722,7 @@ void CAudioPlayerGui::paintTitleBox() if (!m_titlebox) { m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON); - m_titlebox->enableFrame(true, FRAME_MIN_WIDTH); + m_titlebox->enableFrame(true, FRAME_WIDTH_MIN); m_titlebox->setCorner(RADIUS_LARGE); } m_titlebox->paint(false); diff --git a/src/system/settings.h b/src/system/settings.h index fd72578b2..7950a6fa3 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -938,7 +938,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN) -#define FRAME_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(2) +#define FRAME_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(2) #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) From 0dda6b79793300130dae484925c7be344bc3d92e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 29 Jun 2017 19:04:10 +0200 Subject: [PATCH 3/3] src/gui/moviebrowser/mb.cpp fix segfault if m_movieSelectionHandler is NULL Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc5ba460a55a68c7db94365f97c858bc5a3cfece Author: Jacek Jendrzej Date: 2017-06-29 (Thu, 29 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9d3a3e27f..76161a8f7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3449,7 +3449,9 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); - mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + if (m_movieSelectionHandler){ + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + } mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green));