fix segfaults in fluid_is_soundfont() and fluid_is_midifile()

This commit is contained in:
derselbst 2018-12-29 11:18:36 +01:00
parent 488da516cd
commit 4d612c22f4
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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)