From a9ea9f312ba9254d0bfc623b31eaf43467737622 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Jan 2022 23:44:35 +0100 Subject: [PATCH] infoviewer: fix possible segfault If no NEUTRINO_ICON_REC was defined, it will crash here. Now 1st icon will be checked for availability and is used. This error was observed on start of timeshift recording. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed4575ba11150f7e2274ccb7b7f2b83b56adfcd9 Author: Thilo Graf Date: 2022-01-21 (Fri, 21 Jan 2022) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 8476b4cc5..27470edf2 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -322,10 +322,13 @@ void CInfoViewer::showRecordIcon (const bool show) if (rec->isPainted()) { - if (rec->getCCItem(NEUTRINO_ICON_REC)->isPainted()) - rec->getCCItem(NEUTRINO_ICON_REC)->kill(); - else - rec->getCCItem(NEUTRINO_ICON_REC)->paint(); + if (rec->getCCItem(0)) + { + if (rec->getCCItem(0)->isPainted()) + rec->getCCItem(0)->kill(); + else + rec->getCCItem(0)->paint(); + } } else rec->paint();