From b67ab168dae405a270fedfc29fe50453e3b16151 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 29 Sep 2021 17:00:15 +0200 Subject: [PATCH] lcd4l.cpp: exit ParseInfo() on missing instance of videoDecoder --- 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 b0ea5ea48..52f26cdd7 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -469,7 +469,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;