]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
PCI non-existing board access crash fix
authorToni Wilen <twilen@winuae.net>
Sat, 7 Jan 2023 12:39:18 +0000 (14:39 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 7 Jan 2023 12:39:18 +0000 (14:39 +0200)
pci.cpp

diff --git a/pci.cpp b/pci.cpp
index 2e320e18db84086f14646a93a99ffe74962af11b..c9491a358e3d022303de490cad037f0aadc1730b 100644 (file)
--- a/pci.cpp
+++ b/pci.cpp
@@ -358,7 +358,7 @@ static struct pci_board_state *get_pci_board_state(struct pci_bridge *pcib, uaec
        if (io && addr2 < 0x400) {
                for (int i = 0; i < MAX_PCI_BOARDS; i++) {
                        struct pci_board_state *pcibs = &pcib->boards[i];
-                       if (pcibs->board->bars[MAX_PCI_BARS].bget) {
+                       if (pcibs->board && pcibs->board->bars[MAX_PCI_BARS].bget) {
                                stored_board = i;
                                stored_bar = MAX_PCI_BARS;
                                *bar = stored_bar;