EXI/BBA: Add null check in CEXIETHERNET::DirectFIFOWrite

Just in case. DMAWrite calls DirectFIFOWrite with the result of a
GetPointerForRange call without first checking if it's null.
This commit is contained in:
JosJuice 2026-05-31 07:56:06 +02:00
parent 31eaf1d67c
commit 95f3f8c6df

View File

@ -435,7 +435,7 @@ void CEXIETHERNET::DirectFIFOWrite(const u8* data, u32 size)
// GMAC instead of finagling with packet descriptors and such
u16* tx_fifo_count = (u16*)&mBbaMem[BBA_TXFIFOCNT];
if (*tx_fifo_count < BBA_TXFIFO_SIZE)
if (data != nullptr && *tx_fifo_count < BBA_TXFIFO_SIZE)
{
const u32 max_size = BBA_TXFIFO_SIZE - *tx_fifo_count;
memcpy(tx_fifo.get() + *tx_fifo_count, data, std::min(size, max_size));