From b8135d0b1350c702a0b3579eb81c9d2cac9891fb Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 7 Oct 2012 16:02:29 +0200 Subject: [PATCH] streaminfo: fix possible crash if channel == NULL Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/022f269e09c3d246df0c45b831d5c78b003e436d Author: Stefan Seyfried Date: 2012-10-07 (Sun, 07 Oct 2012) --- src/gui/streaminfo2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index e809d609c..8dfd901ed 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -93,6 +93,7 @@ CStreamInfo2::CStreamInfo2 () rate.min_short_average = 0; box_h = 0; box_h2 = 0; + yypos = -1; } CStreamInfo2::~CStreamInfo2 () @@ -897,6 +898,8 @@ void CStreamInfo2::showSNR () int barwidth = 150; int sig, snr; int posx, posy; + if (yypos < 0) + return; /* nothing to paint. No channel or similar */ int sw = g_Font[font_info]->getRenderWidth ("100%"); int pw = g_Font[font_info]->getRenderWidth (" SNR");