From 42c9c76ef5d9c3ad7936ce46e39c8329422c1ec4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 21 Feb 2015 18:21:13 +0100 Subject: [PATCH] streaminfo: don't paint outside of the framebuffer Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/51fddab5a620b594d34027e8d8e08d4610b5efe7 Author: Stefan Seyfried Date: 2015-02-21 (Sat, 21 Feb 2015) --- src/gui/streaminfo2.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 029c76046..624ca1550 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -700,12 +700,10 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) #define NUM_CAIDS 11 void CStreamInfo2::paintCASystem(int xpos, int ypos) { - unsigned short i, ypos1 = 0; + unsigned short i; int box_width = width*2/3-10; - if(box_h2 > 0) - { - frameBuffer->paintBoxRel (0, ypos+(iheight*2), box_width, box_h2, COL_MENUHEAD_PLUS_0); - } + if (box_h2 > 0) + frameBuffer->paintBox(0, ypos+(iheight*2), box_width, box_h2, COL_MENUHEAD_PLUS_0); std::string casys[NUM_CAIDS]={"Irdeto:","Betacrypt:","Seca:","Viaccess:","Nagra:","Conax: ","Cryptoworks:","Videoguard:","EBU:","XCrypt:","PowerVU:"}; bool caids[NUM_CAIDS]; @@ -782,6 +780,10 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) cryptsysteme = false; } ypos += sheight; + if (ypos > max_height) { + ypos -= sheight; + break; + } int width_txt = 0, index = 0; const char *tok = " "; std::string::size_type last_pos = casys[ca_id].find_first_not_of(tok, 0); @@ -800,8 +802,8 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) } } } - if(box_h2 == 0) - box_h2 = ypos - ypos1; + if (box_h2 < ypos) + box_h2 = ypos; } /*