mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Mpeg: Make sure not to demux outside the buffer.
This commit is contained in:
parent
6d14c17f26
commit
b191fd2914
2 changed files with 3 additions and 3 deletions
|
@ -158,7 +158,7 @@ void MpegDemux::demux(int audioChannel)
|
|||
{
|
||||
if (audioChannel >= 0)
|
||||
m_audioChannel = audioChannel;
|
||||
while (m_index < m_len)
|
||||
while (m_index < m_readSize)
|
||||
{
|
||||
if (m_index + 2048 > m_readSize)
|
||||
break;
|
||||
|
@ -202,7 +202,7 @@ void MpegDemux::demux(int audioChannel)
|
|||
}
|
||||
if (m_index < m_readSize) {
|
||||
int size = m_readSize - m_index;
|
||||
memcpy(m_buf, m_buf + m_index, size);
|
||||
memmove(m_buf, m_buf + m_index, size);
|
||||
m_index = 0;
|
||||
m_readSize = size;
|
||||
} else {
|
||||
|
|
|
@ -53,7 +53,7 @@ private:
|
|||
return (((s64) (c & 0x0E)) << 29) | ((read16() >> 1) << 15) | (read16() >> 1);
|
||||
}
|
||||
bool isEOF() const {
|
||||
return m_index >= m_len;
|
||||
return m_index >= m_readSize;
|
||||
}
|
||||
void skip(int n) {
|
||||
if (n > 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue