From 519630b3569b9a68bfddb51ef22233b58e1a728c Mon Sep 17 00:00:00 2001 From: redblue-pkt Date: Sun, 30 Sep 2018 22:42:49 +0200 Subject: [PATCH] fix segfault in standby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a463644b323f8d7eb9d612a18904a85c1b7aedc2 Author: redblue-pkt Date: 2018-09-30 (Sun, 30 Sep 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/simple_display.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/driver/simple_display.cpp b/src/driver/simple_display.cpp index 8276ea2be..619a53122 100644 --- a/src/driver/simple_display.cpp +++ b/src/driver/simple_display.cpp @@ -332,27 +332,30 @@ void CLCD::showTime(bool force) ret = ioctl(fd, VFDSETTIME2, &now); close(fd); #endif + if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) + { #if HAVE_ARM_HARDWARE - if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO)) + if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO)) #else - if (ret < 0 && servicename.empty()) + if (ret < 0 && servicename.empty()) #endif - { - if (g_info.hw_caps->display_xres < 5) - sprintf(timestr, "%02d%02d", hour, minute); - else /* pad with spaces on the left side to center the time string */ - sprintf(timestr, "%*s%02d:%02d",(g_info.hw_caps->display_xres - 5)/2, "", hour, minute); - ShowText(timestr, false); - } - else - { - if (vol_active) { - showServicename(servicename); - vol_active = false; + if (g_info.hw_caps->display_xres < 5) + sprintf(timestr, "%02d%02d", hour, minute); + else /* pad with spaces on the left side to center the time string */ + sprintf(timestr, "%*s%02d:%02d",(g_info.hw_caps->display_xres - 5)/2, "", hour, minute); + ShowText(timestr, false); } + else + { + if (vol_active) + { + showServicename(servicename); + vol_active = false; + } + } + last_display = 0; } - last_display = 0; } }