mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
DSPDisassembler: fail when buffer too large
This commit is contained in:
@ -27,6 +27,12 @@ DSPDisassembler::DSPDisassembler(const AssemblerSettings& settings) : settings_(
|
|||||||
|
|
||||||
bool DSPDisassembler::Disassemble(const std::vector<u16>& code, std::string& text)
|
bool DSPDisassembler::Disassemble(const std::vector<u16>& code, std::string& text)
|
||||||
{
|
{
|
||||||
|
if (code.size() > std::numeric_limits<u16>::max())
|
||||||
|
{
|
||||||
|
text.append("; code too large for 16-bit addressing\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (u16 pc = 0; pc < code.size();)
|
for (u16 pc = 0; pc < code.size();)
|
||||||
{
|
{
|
||||||
if (!DisassembleOpcode(code.data(), &pc, text))
|
if (!DisassembleOpcode(code.data(), &pc, text))
|
||||||
|
Reference in New Issue
Block a user