mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
sndfile: close file properly
This commit is contained in:
parent
790cc0c373
commit
fedc40b45e
@ -400,7 +400,6 @@ static boolean OpenFile(sndfile_t *file, void *data, sf_count_t size)
|
|||||||
|
|
||||||
if (file->sfinfo.frames <= 0 || file->sfinfo.channels <= 0)
|
if (file->sfinfo.frames <= 0 || file->sfinfo.channels <= 0)
|
||||||
{
|
{
|
||||||
CloseFile(file);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +473,6 @@ static boolean OpenFile(sndfile_t *file, void *data, sf_count_t size)
|
|||||||
if (format == AL_NONE)
|
if (format == AL_NONE)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "SndFile: Unsupported channel count %d.\n", file->sfinfo.channels);
|
fprintf(stderr, "SndFile: Unsupported channel count %d.\n", file->sfinfo.channels);
|
||||||
CloseFile(file);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,6 +492,7 @@ boolean I_SND_LoadFile(void *data, ALenum *format, byte **wavdata,
|
|||||||
|
|
||||||
if (OpenFile(&file, data, *size) == false)
|
if (OpenFile(&file, data, *size) == false)
|
||||||
{
|
{
|
||||||
|
CloseFile(&file);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,6 +539,7 @@ static boolean I_SND_OpenStream(void *data, ALsizei size, ALenum *format,
|
|||||||
|
|
||||||
if (OpenFile(&stream, data, size) == false)
|
if (OpenFile(&stream, data, size) == false)
|
||||||
{
|
{
|
||||||
|
CloseFile(&stream);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user