1
Audio / Heap Corruption Issue with sf::SoundBuffer::loadFromFile
« on: July 18, 2014, 12:18:54 pm »
To get it out of the way, we're using the correct libraries already (Double checked for debug libs).
Now for some odd reason we've been having a heap corruption issue in our game, and I turned on page-heap safety thing with gflags todo some hardcore debugging of it, and it keeps popping back to..
The last place it goes before all hell breaks loose in MSVCR is
SoundBuffer.cpp:222
if (file.read(&m_samples[0], sampleCount) == sampleCount)
With params.
Now for some odd reason we've been having a heap corruption issue in our game, and I turned on page-heap safety thing with gflags todo some hardcore debugging of it, and it keeps popping back to..
KernelBase.dll!_RaiseException@16() Unknown
[External Code]
msvcr120d.dll!operator new(unsigned int size) Line 63 C++
Game.exe!std::_Allocate<short>(unsigned int _Count, short * __formal) Line 28 C++
Game.exe!std::allocator<short>::allocate(unsigned int _Count) Line 578 C++
Game.exe!std::_Wrap_alloc<std::allocator<short> >::allocate(unsigned int _Count) Line 848 C++
Game.exe!std::vector<short,std::allocator<short> >::_Reallocate(unsigned int _Count) Line 1588 C++
Game.exe!std::vector<short,std::allocator<short> >::_Reserve(unsigned int _Count) Line 1619 C++
Game.exe!std::vector<short,std::allocator<short> >::resize(unsigned int _Newsize) Line 1107 C++
Game.exe!sf::SoundBuffer::initialize(sf::priv::SoundFile & file) Line 222 C++
> Game.exe!sf::SoundBuffer::loadFromFile(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & filename) Line 84 C++
Game.exe!ResourceSound::resolve() Line 53 C++
[External Code]
msvcr120d.dll!operator new(unsigned int size) Line 63 C++
Game.exe!std::_Allocate<short>(unsigned int _Count, short * __formal) Line 28 C++
Game.exe!std::allocator<short>::allocate(unsigned int _Count) Line 578 C++
Game.exe!std::_Wrap_alloc<std::allocator<short> >::allocate(unsigned int _Count) Line 848 C++
Game.exe!std::vector<short,std::allocator<short> >::_Reallocate(unsigned int _Count) Line 1588 C++
Game.exe!std::vector<short,std::allocator<short> >::_Reserve(unsigned int _Count) Line 1619 C++
Game.exe!std::vector<short,std::allocator<short> >::resize(unsigned int _Newsize) Line 1107 C++
Game.exe!sf::SoundBuffer::initialize(sf::priv::SoundFile & file) Line 222 C++
> Game.exe!sf::SoundBuffer::loadFromFile(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & filename) Line 84 C++
Game.exe!ResourceSound::resolve() Line 53 C++
The last place it goes before all hell breaks loose in MSVCR is
SoundBuffer.cpp:222
if (file.read(&m_samples[0], sampleCount) == sampleCount)
With params.
+ &m_samples 0x3d857fcc { size=0 } std::vector<short,std::allocator<short> > *
+ file {m_file=0x795badd0 {...} m_memory={begin=0xcccccccc <Error reading characters of string.> current=0xcccccccc <Error reading characters of string.> ...} ...} sf::priv::SoundFile &
+ m_samples { size=0 } std::vector<short,std::allocator<short> >
sampleCount 357554 unsigned int
+ this 0x3d857fc8 {m_buffer=938442712 m_samples={ size=0 } m_duration={m_microseconds=0 } ...} sf::SoundBuffer *
+ file {m_file=0x795badd0 {...} m_memory={begin=0xcccccccc <Error reading characters of string.> current=0xcccccccc <Error reading characters of string.> ...} ...} sf::priv::SoundFile &
+ m_samples { size=0 } std::vector<short,std::allocator<short> >
sampleCount 357554 unsigned int
+ this 0x3d857fc8 {m_buffer=938442712 m_samples={ size=0 } m_duration={m_microseconds=0 } ...} sf::SoundBuffer *