From da241ca4be855cd23d4969ba906c3d83b195e191 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 1 Oct 2021 23:08:53 +0200 Subject: [PATCH] lcd4l.cpp: exit ParseInfo() on missing instance of videoDecoder Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/731853f1abb39d71d08530b29c7a3a03a0a6fab4 Author: Thilo Graf Date: 2021-10-01 (Fri, 01 Oct 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/lcd4l.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index 18a541047..d073ccad0 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -466,7 +466,15 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) /* ----------------------------------------------------------------- */ int x_res, y_res, framerate; - videoDecoder->getPictureInfo(x_res, y_res, framerate); + if (videoDecoder) + { // Hack: That should not happen, but while shutting down there + // could be a null pointer and this can lead to a crash. + // This behavior was observed with LeakSanitizer on pc hardware. + videoDecoder->getPictureInfo(x_res, y_res, framerate); + } + else + return; + if (y_res == 1088) y_res = 1080;