Skip to content

Commit

Permalink
playopl[adplug]:
Browse files Browse the repository at this point in the history
 * detecting .BAM files with .NNN filenames could case strcasecmp() to be called infront filename for very short filenames.
 * Remove adplugdb->wipe() call, it is not for freeing memory
  • Loading branch information
mywave82 committed May 5, 2024
1 parent d2da9c4 commit 09385a6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions playopl/opltype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int oplReadInfo(struct moduleinfostruct *m, struct ocpfilehandle_t *f, co
filenamelen = strlen (filename);

/* Bob's Adlib Music */
if (((filenamelen > 4) && (!strcasecmp (filename - 4, ".bam"))) || /* adplug default to match *.bam */
if (((filenamelen > 4) && (!strcasecmp (filename + filenamelen - 4, ".bam"))) || /* adplug default to match *.bam */
((filenamelen > 2) && (filename[filenamelen - 2] == '.') && isdigit (filename[filenamelen-1])) || /* also match *.[0-9] */
((filenamelen > 3) && (filename[filenamelen - 3] == '.') && isdigit (filename[filenamelen-2]) && isdigit (filename[filenamelen-1])) ) /* also match *.[0-9][0-9] */
{
Expand Down Expand Up @@ -161,7 +161,6 @@ OCP_INTERNAL void opl_type_done (PluginCloseAPI_t *API)
if (adplugdb_ocp)
{
CAdPlug::set_database (0);
adplugdb_ocp->wipe();
delete (adplugdb_ocp);
adplugdb_ocp = 0;
}
Expand Down

0 comments on commit 09385a6

Please sign in to comment.