From 09385a69b0724bf2926112aecfa712c8789bdabc Mon Sep 17 00:00:00 2001 From: Stian Skjelstad Date: Mon, 15 Apr 2024 13:02:39 +0200 Subject: [PATCH] playopl[adplug]: * 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 --- playopl/opltype.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playopl/opltype.cpp b/playopl/opltype.cpp index cd79b79e..35e0e0ba 100644 --- a/playopl/opltype.cpp +++ b/playopl/opltype.cpp @@ -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] */ { @@ -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; }