mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 06:51:54 +00:00
fix segfaults in fluid_is_soundfont() and fluid_is_midifile()
This commit is contained in:
parent
488da516cd
commit
4d612c22f4
2 changed files with 4 additions and 4 deletions
|
@ -94,13 +94,13 @@ int fluid_is_midifile(const char *filename)
|
||||||
{
|
{
|
||||||
FILE *fp = FLUID_FOPEN(filename, "rb");
|
FILE *fp = FLUID_FOPEN(filename, "rb");
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
int retcode = 0;
|
int retcode = FALSE;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(fp == NULL)
|
if(fp == NULL)
|
||||||
{
|
{
|
||||||
break;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FLUID_FREAD(&id, sizeof(id), 1, fp) != 1)
|
if(FLUID_FREAD(&id, sizeof(id), 1, fp) != 1)
|
||||||
|
|
|
@ -336,13 +336,13 @@ int fluid_is_soundfont(const char *filename)
|
||||||
{
|
{
|
||||||
FILE *fp = FLUID_FOPEN(filename, "rb");
|
FILE *fp = FLUID_FOPEN(filename, "rb");
|
||||||
uint32_t fcc;
|
uint32_t fcc;
|
||||||
int retcode = 0;
|
int retcode = FALSE;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(fp == NULL)
|
if(fp == NULL)
|
||||||
{
|
{
|
||||||
break;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FLUID_FREAD(&fcc, sizeof(fcc), 1, fp) != 1)
|
if(FLUID_FREAD(&fcc, sizeof(fcc), 1, fp) != 1)
|
||||||
|
|
Loading…
Reference in a new issue