mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
fluid_is_midifile(): only accept regular files
This commit is contained in:
parent
64c90a6c49
commit
06ef8a4e09
2 changed files with 8 additions and 1 deletions
|
@ -298,7 +298,7 @@ new_fluid_file_renderer(fluid_synth_t *synth)
|
|||
sf_command(dev->sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE);
|
||||
|
||||
#else
|
||||
dev->file = fopen(filename, "wb");
|
||||
dev->file = FLUID_FOPEN(filename, "wb");
|
||||
|
||||
if(dev->file == NULL)
|
||||
{
|
||||
|
|
|
@ -103,6 +103,13 @@ int fluid_is_midifile(const char *filename)
|
|||
return retcode;
|
||||
}
|
||||
|
||||
// file exists and we have permission to open it
|
||||
// now, test whether it's acutally a regular file or a symlink to such
|
||||
if(!fluid_file_test(filename, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if(FLUID_FREAD(&id, sizeof(id), 1, fp) != 1)
|
||||
{
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue