mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-15 20:30:49 +00:00
Improve chunk id search (#471)
If we move UNKN_ID to the bottom of the enum, in the for() cycle inside chunkid() if the value is not found then the "i" variable will be already UNKN_ID.
This commit is contained in:
parent
36da011191
commit
b8b41f781f
1 changed files with 6 additions and 4 deletions
|
@ -43,7 +43,6 @@
|
|||
/* sf file chunk IDs */
|
||||
enum
|
||||
{
|
||||
UNKN_ID,
|
||||
RIFF_ID,
|
||||
LIST_ID,
|
||||
SFBK_ID,
|
||||
|
@ -74,7 +73,9 @@ enum
|
|||
IMOD_ID,
|
||||
IGEN_ID, /* instrument ids */
|
||||
SHDR_ID, /* sample info */
|
||||
SM24_ID
|
||||
SM24_ID,
|
||||
|
||||
UNKN_ID
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -517,11 +518,12 @@ static int chunkid(uint32_t id)
|
|||
{
|
||||
if(*p == id)
|
||||
{
|
||||
return (i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return UNKN_ID;
|
||||
/* Return chunk id or UNKN_ID if not found */
|
||||
return i;
|
||||
}
|
||||
|
||||
static int load_header(SFData *sf)
|
||||
|
|
Loading…
Reference in a new issue