From 7f2d3c4d1cab33789d32efb539692fda8f4da3a9 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 27 Jul 2025 15:47:02 +0200 Subject: [PATCH] 8514/a: Add some sanity checks. --- src/video/vid_8514a.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index c8191a876..90937d008 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -334,6 +334,9 @@ ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len) { ibm8514_t *dev = (ibm8514_t *) svga->dev8514; + if (dev == NULL) + return; + if (port & 0x8000) { if ((port != 0xe2e8) && (port != 0xe2e9) && (port != 0xe6e8) && (port != 0xe6e9)) { if (port & 0x4000) @@ -743,6 +746,9 @@ ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len) { ibm8514_t *dev = (ibm8514_t *) svga->dev8514; + if (dev == NULL) + return; + if (port & 0x8000) { if (dev->accel.cmd_back) { dev->fifo_idx++; @@ -777,6 +783,9 @@ ibm8514_accel_in_fifo(svga_t *svga, uint16_t port, int len) uint16_t temp = 0; int cmd = 0; + if (dev == NULL) + return 0xffff; + switch (port) { case 0x82e8: if (len == 2)