mirror of https://github.com/ZDoom/fluidsynth.git
fluid_is_midifile(): only accept regular files
This commit is contained in:
parent
64c90a6c49
commit
06ef8a4e09
|
@ -298,7 +298,7 @@ new_fluid_file_renderer(fluid_synth_t *synth)
|
||||||
sf_command(dev->sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE);
|
sf_command(dev->sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
dev->file = fopen(filename, "wb");
|
dev->file = FLUID_FOPEN(filename, "wb");
|
||||||
|
|
||||||
if(dev->file == NULL)
|
if(dev->file == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,6 +102,13 @@ int fluid_is_midifile(const char *filename)
|
||||||
{
|
{
|
||||||
return retcode;
|
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)
|
if(FLUID_FREAD(&id, sizeof(id), 1, fp) != 1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue