diff --git a/Core/HW/MpegDemux.cpp b/Core/HW/MpegDemux.cpp index b42403630f..74e39b1a99 100644 --- a/Core/HW/MpegDemux.cpp +++ b/Core/HW/MpegDemux.cpp @@ -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 { diff --git a/Core/HW/MpegDemux.h b/Core/HW/MpegDemux.h index 1394cd8604..6e3756ad48 100644 --- a/Core/HW/MpegDemux.h +++ b/Core/HW/MpegDemux.h @@ -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) {