1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

USIO: Always resize the response vector to the given size

This commit is contained in:
brian218 2023-01-26 21:42:21 +08:00 committed by Megamouse
parent 49455965c0
commit 71c3264ea7

View File

@ -384,7 +384,7 @@ void usb_device_usio::usio_read(u8 channel, u16 reg, u16 size)
case 0x7000:
{
// Card reader check - 2
response.resize(size);
// No data returned
break;
}
case 0x1080:
@ -444,13 +444,12 @@ void usb_device_usio::usio_read(u8 channel, u16 reg, u16 size)
case 0x1000:
{
//ensure(size == 0x1000);
response.resize(size);
// No data returned
break;
}
default:
{
usio_log.error("Unhandled read of sram(chip: %d, addr: 0x%04X)", channel - 2, reg);
response.resize(size);
break;
}
}
@ -459,7 +458,6 @@ void usb_device_usio::usio_read(u8 channel, u16 reg, u16 size)
default:
{
usio_log.error("Unhandled read of sram(chip: %d, addr: 0x%04X)", channel - 2, reg);
response.resize(size);
break;
}
}
@ -470,6 +468,8 @@ void usb_device_usio::usio_read(u8 channel, u16 reg, u16 size)
// We are not using any firmware since this is emulation.
usio_log.warning("Unsupported read operation(channel: 0x%02X, addr: 0x%04X)", channel, reg);
}
response.resize(size); // Always resize the response vector to the given size
}
void usb_device_usio::interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, UsbTransfer* transfer)