AUDIO: Fix crash when OPL driver isn't loaded

Fixes segfault when logging that an OPL driver doesn't support the
emulation type requested by a game.

The code used driver id as an array index, but this is incorrect
because array indexes depends on which drivers are compiled in.

This issue was identified and fixed in 2015, but this line was missed:
6f01600e12ba14acde8a6557716783861dc014d1

Fixes the crash in bug #14413
This commit is contained in:
sluicebox 2023-04-15 15:33:07 -07:00
parent 6ff2212f51
commit 8db3779f7d

View File

@ -155,7 +155,7 @@ Config::DriverId Config::detect(OplType type) {
} else {
// Else we will output a warning and just
// return that no valid driver is found.
warning("Your selected OPL driver \"%s\" does not support type %d emulation, which is requested by your game", _drivers[drv].description, type);
warning("Your selected OPL driver \"%s\" does not support type %d emulation, which is requested by your game", driverDesc->description, type);
return -1;
}
}