From bd63d1dcdaa93cae28220217ac041d019153f2ad Mon Sep 17 00:00:00 2001 From: joevt Date: Sun, 18 Feb 2024 18:14:31 -0800 Subject: [PATCH] platinum: Validity check before enable display. --- devices/memctrl/platinum.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices/memctrl/platinum.cpp b/devices/memctrl/platinum.cpp index 3eb1484..05698e8 100644 --- a/devices/memctrl/platinum.cpp +++ b/devices/memctrl/platinum.cpp @@ -444,6 +444,13 @@ void PlatinumCtrl::enable_display() { this->stop_refresh_task(); + if (this->active_width <= 0 || this->active_height <= 0 || this->pixel_clock <= 0) { + this->blank_on = true; + this->crtc_on = false; + this->blank_display(); + return; + } + this->refresh_rate = (double)(this->pixel_clock) / (this->hori_total * this->vert_total); this->start_refresh_task();