fixed read content of ES

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2392 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2009-02-23 19:19:38 +00:00
parent cd93093cc8
commit dda5ca5c73
1 changed files with 11 additions and 2 deletions

View File

@ -176,8 +176,16 @@ public:
u8* pSrc = &rContent.m_pContent->m_pData[rContent.m_Position];
u8* pDest = Memory::GetPointer(Addr);
memcpy(pDest,pSrc, Size);
rContent.m_Position += Size;
if (rContent.m_Position + Size > rContent.m_pContent->m_Size)
{
Size = rContent.m_pContent->m_Size-rContent.m_Position;
}
if (Size > 0)
{
memcpy(pDest,pSrc, Size);
rContent.m_Position += Size;
}
LOG(WII_IPC_ES, "ES: IOCTL_ES_READCONTENT: CFD %x, Addr 0x%x, Size %i -> stream pos %i", CFD, Addr, Size, rContent.m_Position);
@ -217,6 +225,7 @@ public:
break;
case 1: // CUR
rContent.m_Position += Addr;
break;
case 2: // END