Stop trying to read samples if there was an error

This commit is contained in:
Chris Robinson 2014-07-19 20:46:12 -07:00
parent 9370fea359
commit 0c31ccd456

View File

@ -1120,7 +1120,7 @@ ALboolean loadSf2(Reader *stream, ALsoundfont *soundfont, ALCcontext *context)
else
{
ALuint total = 0;
while(total < smpl.mSize)
while(total < smpl.mSize && !READERR(stream))
{
ALbyte buf[4096];
ALuint todo = minu(smpl.mSize-total, sizeof(buf));