mirror of
https://github.com/SFML/SFML.git
synced 2025-02-08 01:18:02 +08:00
Fixed potential buffer overflow in SoundFileReaderWav
This commit is contained in:
parent
9d3024e13e
commit
81a8e4e4ca
@ -232,8 +232,7 @@ bool SoundFileReaderWav::parseHeader(Info& info)
|
|||||||
// Skip potential extra information (should not exist for PCM)
|
// Skip potential extra information (should not exist for PCM)
|
||||||
if (subChunkSize > 16)
|
if (subChunkSize > 16)
|
||||||
{
|
{
|
||||||
char buffer[1024];
|
if (m_stream->seek(m_stream->tell() + subChunkSize - 16) == -1)
|
||||||
if (m_stream->read(buffer, subChunkSize - 16) != subChunkSize - 16)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -252,8 +251,7 @@ bool SoundFileReaderWav::parseHeader(Info& info)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// unknown chunk, skip it
|
// unknown chunk, skip it
|
||||||
char buffer[1024];
|
if (m_stream->seek(m_stream->tell() + subChunkSize) == -1)
|
||||||
if (m_stream->read(buffer, subChunkSize) != subChunkSize)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user