From 328f6487996a23bc31ec431335cde86b62dcc696 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Oct 2019 22:56:49 +0100 Subject: [PATCH] fb_generic: avoid possible crash on shutdown Observed on generic platform. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a8f62d37fc28615766a9a59a0a72d2c84909befe Author: Thilo Graf Date: 2019-10-27 (Sun, 27 Oct 2019) ------------------ This commit was generated by Migit --- src/driver/fb_generic.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 4940fafcd..fa5731c27 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -1551,13 +1551,18 @@ bool CFrameBuffer::showFrame(const std::string & filename, int fallback_mode) if (access(picture.c_str(), F_OK) == 0) { + if (videoDecoder) + { #if HAVE_COOL_HARDWARE //FIXME: inside libcs no return value available - videoDecoder->ShowPicture(picture.c_str()); - ret = true; -#else - if (videoDecoder->ShowPicture(picture.c_str())) + videoDecoder->ShowPicture(picture.c_str()); ret = true; +#else + if (videoDecoder->ShowPicture(picture.c_str())) + ret = true; #endif + } + else + dprintf(DEBUG_NORMAL,"[CFrameBuffer]\[%s - %d], no videoplayer instance available\n", __func__, __LINE__); } else {