mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-11 10:24:43 +00:00
sceMpegRingbufferPut fix (Handle numPackets <= 0)
This commit is contained in:
parent
30df95c5e7
commit
024a61e058
@ -1044,11 +1044,14 @@ u32 sceMpegRingbufferPut(u32 ringbufferAddr, u32 numPackets, u32 available)
|
||||
return 0;
|
||||
}
|
||||
|
||||
numPackets = std::min(numPackets, available);
|
||||
if (numPackets <= 0) {
|
||||
ERROR_LOG(HLE, "zero or sub-zero number of packets put");
|
||||
return 0;
|
||||
}
|
||||
SceMpegRingBuffer ringbuffer;
|
||||
Memory::ReadStruct(ringbufferAddr, &ringbuffer);
|
||||
|
||||
numPackets = std::min(numPackets, available);
|
||||
|
||||
MpegContext *ctx = getMpegCtx(ringbuffer.mpeg);
|
||||
if (!ctx) {
|
||||
WARN_LOG(HLE, "sceMpegRingbufferPut(%08x, %i, %i): bad mpeg handle %08x", ringbufferAddr, numPackets, available, ringbuffer.mpeg);
|
||||
|
Loading…
Reference in New Issue
Block a user