libmodplug-0.8.9.0-29.fc44

List of Findings

Error: COMPILER_WARNING (CWE-758): [#def1]
libmodplug-0.8.9.0/src/fastmix.cpp: scope_hint: In function ‘VOID Mono8BitMix(MODCHANNEL*, int*, int*)’
libmodplug-0.8.9.0/src/fastmix.cpp:291:37: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  291 |         register MODCHANNEL * const pChn = pChannel;\
#      |                                     ^~~~
libmodplug-0.8.9.0/src/fastmix.cpp:678:9: note: in expansion of macro ‘SNDMIX_BEGINSAMPLELOOP8’
#  678 |         SNDMIX_BEGINSAMPLELOOP8
#      |         ^~~~~~~~~~~~~~~~~~~~~~~
#  289|   // ----------------------------------------------------------------------------
#  290|   #define SNDMIX_BEGINSAMPLELOOP8\
#  291|-> 	register MODCHANNEL * const pChn = pChannel;\
#  292|   	nPos = pChn->nPosLo;\
#  293|   	const signed char *p = (signed char *)(pChn->pCurrentSample+pChn->nPos);\

Error: COMPILER_WARNING (CWE-758): [#def2]
libmodplug-0.8.9.0/src/fastmix.cpp: scope_hint: In function ‘VOID Mono16BitMix(MODCHANNEL*, int*, int*)’
libmodplug-0.8.9.0/src/fastmix.cpp:299:37: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  299 |         register MODCHANNEL * const pChn = pChannel;\
#      |                                     ^~~~
libmodplug-0.8.9.0/src/fastmix.cpp:684:9: note: in expansion of macro ‘SNDMIX_BEGINSAMPLELOOP16’
#  684 |         SNDMIX_BEGINSAMPLELOOP16
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~
#  297|   
#  298|   #define SNDMIX_BEGINSAMPLELOOP16\
#  299|-> 	register MODCHANNEL * const pChn = pChannel;\
#  300|   	nPos = pChn->nPosLo;\
#  301|   	const signed short *p = (signed short *)(pChn->pCurrentSample+(pChn->nPos*2));\

Error: COMPILER_WARNING: [#def3]
libmodplug-0.8.9.0/src/fastmix.cpp: scope_hint: In member function ‘UINT CSoundFile::CreateStereoMix(int)’
libmodplug-0.8.9.0/src/fastmix.cpp:1488:30: warning[-Wunused-but-set-variable=]: variable ‘nMasterCh’ set but not used
# 1488 |                 UINT nFlags, nMasterCh;
#      |                              ^~~~~~~~~
# 1486|   		const LPMIXINTERFACE *pMixFuncTable;
# 1487|   		MODCHANNEL * const pChannel = &Chn[ChnMix[nChn]];
# 1488|-> 		UINT nFlags, nMasterCh;
# 1489|   		LONG nSmpCount;
# 1490|   		int nsamples;

Error: COMPILER_WARNING: [#def4]
libmodplug-0.8.9.0/src/load_669.cpp: scope_hint: In member function ‘BOOL CSoundFile::Read669(const BYTE*, DWORD)’
libmodplug-0.8.9.0/src/load_669.cpp:51:14: warning[-Wunused-but-set-variable=]: variable ‘b669Ext’ set but not used
#   51 |         BOOL b669Ext;
#      |              ^~~~~~~
#   49|   //---------------------------------------------------------------
#   50|   {
#   51|-> 	BOOL b669Ext;
#   52|   	const FILEHEADER669 *pfh = (const FILEHEADER669 *)lpStream;
#   53|   	const SAMPLE669 *psmp = (const SAMPLE669 *)(lpStream + 0x1F1);

Error: COMPILER_WARNING: [#def5]
libmodplug-0.8.9.0/src/load_abc.cpp:428:3: warning[-Wodr]: type 'struct MMFILE' violates the C++ One Definition Rule
#  428 | } MMFILE;
#      |   ^
libmodplug-0.8.9.0/src/load_mid.cpp:108:3: note: a different type is defined in another translation unit
#  108 | } MMFILE;
#      |   ^
libmodplug-0.8.9.0/src/load_abc.cpp:426:13: note: the first difference of corresponding definitions is field 'sz'
#  426 |         int sz;
#      |             ^
libmodplug-0.8.9.0/src/load_mid.cpp:106:22: note: a field of same name but different type is defined in another translation unit
#  106 |         unsigned int sz;
#      |                      ^
libmodplug-0.8.9.0/src/load_abc.cpp:428:3: note: type 'int' should match type 'unsigned int'
#  428 | } MMFILE;
#      |   ^
#  426|   	int sz;
#  427|   	int pos;
#  428|-> } MMFILE;
#  429|   
#  430|   static MMFILE *mmfopen(const char *name, const char *mode)

Error: COMPILER_WARNING (CWE-252): [#def6]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘MMFILE* mmfopen(const char*, const char*)’
libmodplug-0.8.9.0/src/load_abc.cpp:447:14: warning[-Wunused-result]: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’
#  447 |         fread(&mmfile[1],1,len,fp);
#      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
#  445|   	}
#  446|   	fseek(fp, 0, SEEK_SET);
#  447|-> 	fread(&mmfile[1],1,len,fp);
#  448|   	fclose(fp);
#  449|   	mmfile->mm = (char *)&mmfile[1];

Error: CPPCHECK_WARNING (CWE-476): [#def7]
libmodplug-0.8.9.0/src/load_abc.cpp:520: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  518|   
#  519|   	retval = (ABCEVENT *)_mm_calloc(h->trackhandle, 1,sizeof(ABCEVENT));
#  520|-> 	retval->next        = NULL;
#  521|   	retval->tracktick   = abctick;
#  522|   	for( i=0; i<6; i++ )

Error: CPPCHECK_WARNING (CWE-476): [#def8]
libmodplug-0.8.9.0/src/load_abc.cpp:521: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  519|   	retval = (ABCEVENT *)_mm_calloc(h->trackhandle, 1,sizeof(ABCEVENT));
#  520|   	retval->next        = NULL;
#  521|-> 	retval->tracktick   = abctick;
#  522|   	for( i=0; i<6; i++ )
#  523|   	    retval->par[i]  = data[i];

Error: CPPCHECK_WARNING (CWE-476): [#def9]
libmodplug-0.8.9.0/src/load_abc.cpp:523: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  521|   	retval->tracktick   = abctick;
#  522|   	for( i=0; i<6; i++ )
#  523|-> 	    retval->par[i]  = data[i];
#  524|   	retval->part = global_part;
#  525|   	retval->tiednote = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def10]
libmodplug-0.8.9.0/src/load_abc.cpp:524: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  522|   	for( i=0; i<6; i++ )
#  523|   	    retval->par[i]  = data[i];
#  524|-> 	retval->part = global_part;
#  525|   	retval->tiednote = 0;
#  526|   	return retval;

Error: CPPCHECK_WARNING (CWE-476): [#def11]
libmodplug-0.8.9.0/src/load_abc.cpp:525: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  523|   	    retval->par[i]  = data[i];
#  524|   	retval->part = global_part;
#  525|-> 	retval->tiednote = 0;
#  526|   	return retval;
#  527|   }

Error: CPPCHECK_WARNING (CWE-476): [#def12]
libmodplug-0.8.9.0/src/load_abc.cpp:535: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  533|   	ABCEVENT *e;
#  534|   	e = (ABCEVENT *)_mm_calloc(h->trackhandle, 1,sizeof(ABCEVENT));
#  535|-> 	e->next        = NULL;
#  536|   	e->tracktick   = se->tracktick;
#  537|   	e->flg         = se->flg;

Error: CPPCHECK_WARNING (CWE-476): [#def13]
libmodplug-0.8.9.0/src/load_abc.cpp:536: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  534|   	e = (ABCEVENT *)_mm_calloc(h->trackhandle, 1,sizeof(ABCEVENT));
#  535|   	e->next        = NULL;
#  536|-> 	e->tracktick   = se->tracktick;
#  537|   	e->flg         = se->flg;
#  538|   	e->cmd         = se->cmd;

Error: CPPCHECK_WARNING (CWE-476): [#def14]
libmodplug-0.8.9.0/src/load_abc.cpp:537: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  535|   	e->next        = NULL;
#  536|   	e->tracktick   = se->tracktick;
#  537|-> 	e->flg         = se->flg;
#  538|   	e->cmd         = se->cmd;
#  539|   	e->lpar        = se->lpar;

Error: CPPCHECK_WARNING (CWE-476): [#def15]
libmodplug-0.8.9.0/src/load_abc.cpp:538: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  536|   	e->tracktick   = se->tracktick;
#  537|   	e->flg         = se->flg;
#  538|-> 	e->cmd         = se->cmd;
#  539|   	e->lpar        = se->lpar;
#  540|   	e->part        = se->part;

Error: CPPCHECK_WARNING (CWE-476): [#def16]
libmodplug-0.8.9.0/src/load_abc.cpp:539: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  537|   	e->flg         = se->flg;
#  538|   	e->cmd         = se->cmd;
#  539|-> 	e->lpar        = se->lpar;
#  540|   	e->part        = se->part;
#  541|   	return e;

Error: CPPCHECK_WARNING (CWE-476): [#def17]
libmodplug-0.8.9.0/src/load_abc.cpp:540: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e
#  538|   	e->cmd         = se->cmd;
#  539|   	e->lpar        = se->lpar;
#  540|-> 	e->part        = se->part;
#  541|   	return e;
#  542|   }

Error: CPPCHECK_WARNING (CWE-476): [#def18]
libmodplug-0.8.9.0/src/load_abc.cpp:553: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  551|   
#  552|   	retval = (ABCMACRO *)_mm_calloc(h->macrohandle, 1,sizeof(ABCMACRO));
#  553|-> 	retval->name  = DupStr(h->macrohandle, key, strlen(key));
#  554|   	retval->n     = strrchr(retval->name, 'n'); // for transposing macro's
#  555|   	retval->subst = DupStr(h->macrohandle, value, strlen(value));

Error: CPPCHECK_WARNING (CWE-476): [#def19]
libmodplug-0.8.9.0/src/load_abc.cpp:554: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  552|   	retval = (ABCMACRO *)_mm_calloc(h->macrohandle, 1,sizeof(ABCMACRO));
#  553|   	retval->name  = DupStr(h->macrohandle, key, strlen(key));
#  554|-> 	retval->n     = strrchr(retval->name, 'n'); // for transposing macro's
#  555|   	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  556|   	retval->next  = h->macro;

Error: CPPCHECK_WARNING (CWE-476): [#def20]
libmodplug-0.8.9.0/src/load_abc.cpp:555: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  553|   	retval->name  = DupStr(h->macrohandle, key, strlen(key));
#  554|   	retval->n     = strrchr(retval->name, 'n'); // for transposing macro's
#  555|-> 	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  556|   	retval->next  = h->macro;
#  557|   	h->macro      = retval;

Error: CPPCHECK_WARNING (CWE-476): [#def21]
libmodplug-0.8.9.0/src/load_abc.cpp:556: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  554|   	retval->n     = strrchr(retval->name, 'n'); // for transposing macro's
#  555|   	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  556|-> 	retval->next  = h->macro;
#  557|   	h->macro      = retval;
#  558|   }

Error: CPPCHECK_WARNING (CWE-476): [#def22]
libmodplug-0.8.9.0/src/load_abc.cpp:584: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  582|   	}
#  583|   	retval = (ABCMACRO *)_mm_calloc(h->macrohandle, 1,sizeof(ABCMACRO));
#  584|-> 	retval->name  = DupStr(h->macrohandle, key, 1);
#  585|   	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  586|   	retval->n     = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def23]
libmodplug-0.8.9.0/src/load_abc.cpp:585: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  583|   	retval = (ABCMACRO *)_mm_calloc(h->macrohandle, 1,sizeof(ABCMACRO));
#  584|   	retval->name  = DupStr(h->macrohandle, key, 1);
#  585|-> 	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  586|   	retval->n     = 0;
#  587|   	retval->next  = h->umacro; // by placing it up front we mask out the old macro until we +nil+ it

Error: CPPCHECK_WARNING (CWE-476): [#def24]
libmodplug-0.8.9.0/src/load_abc.cpp:586: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  584|   	retval->name  = DupStr(h->macrohandle, key, 1);
#  585|   	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  586|-> 	retval->n     = 0;
#  587|   	retval->next  = h->umacro; // by placing it up front we mask out the old macro until we +nil+ it
#  588|   	h->umacro      = retval;

Error: CPPCHECK_WARNING (CWE-476): [#def25]
libmodplug-0.8.9.0/src/load_abc.cpp:587: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  585|   	retval->subst = DupStr(h->macrohandle, value, strlen(value));
#  586|   	retval->n     = 0;
#  587|-> 	retval->next  = h->umacro; // by placing it up front we mask out the old macro until we +nil+ it
#  588|   	h->umacro      = retval;
#  589|   }

Error: CPPCHECK_WARNING (CWE-476): [#def26]
libmodplug-0.8.9.0/src/load_abc.cpp:598: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  596|   	if( !pos ) global_voiceno++;
#  597|   	retval = (ABCTRACK *)_mm_calloc(h->trackhandle, 1,sizeof(ABCTRACK));
#  598|-> 	retval->next         = NULL;
#  599|   	retval->vno          = global_voiceno;
#  600|   	retval->vpos         = pos;

Error: CPPCHECK_WARNING (CWE-476): [#def27]
libmodplug-0.8.9.0/src/load_abc.cpp:599: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  597|   	retval = (ABCTRACK *)_mm_calloc(h->trackhandle, 1,sizeof(ABCTRACK));
#  598|   	retval->next         = NULL;
#  599|-> 	retval->vno          = global_voiceno;
#  600|   	retval->vpos         = pos;
#  601|   	retval->tiedvpos     = pos;

Error: CPPCHECK_WARNING (CWE-476): [#def28]
libmodplug-0.8.9.0/src/load_abc.cpp:600: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  598|   	retval->next         = NULL;
#  599|   	retval->vno          = global_voiceno;
#  600|-> 	retval->vpos         = pos;
#  601|   	retval->tiedvpos     = pos;
#  602|   	retval->instr        = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def29]
libmodplug-0.8.9.0/src/load_abc.cpp:601: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  599|   	retval->vno          = global_voiceno;
#  600|   	retval->vpos         = pos;
#  601|-> 	retval->tiedvpos     = pos;
#  602|   	retval->instr        = 1;
#  603|   	strncpy(retval->v, voice, 20);

Error: CPPCHECK_WARNING (CWE-476): [#def30]
libmodplug-0.8.9.0/src/load_abc.cpp:602: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  600|   	retval->vpos         = pos;
#  601|   	retval->tiedvpos     = pos;
#  602|-> 	retval->instr        = 1;
#  603|   	strncpy(retval->v, voice, 20);
#  604|   	retval->v[20]        = '\0';

Error: CPPCHECK_WARNING (CWE-476): [#def31]
libmodplug-0.8.9.0/src/load_abc.cpp:603: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  601|   	retval->tiedvpos     = pos;
#  602|   	retval->instr        = 1;
#  603|-> 	strncpy(retval->v, voice, 20);
#  604|   	retval->v[20]        = '\0';
#  605|   	retval->head         = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def32]
libmodplug-0.8.9.0/src/load_abc.cpp:604: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  602|   	retval->instr        = 1;
#  603|   	strncpy(retval->v, voice, 20);
#  604|-> 	retval->v[20]        = '\0';
#  605|   	retval->head         = NULL;
#  606|   	retval->tail         = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def33]
libmodplug-0.8.9.0/src/load_abc.cpp:605: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  603|   	strncpy(retval->v, voice, 20);
#  604|   	retval->v[20]        = '\0';
#  605|-> 	retval->head         = NULL;
#  606|   	retval->tail         = NULL;
#  607|   	retval->capostart    = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def34]
libmodplug-0.8.9.0/src/load_abc.cpp:606: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  604|   	retval->v[20]        = '\0';
#  605|   	retval->head         = NULL;
#  606|-> 	retval->tail         = NULL;
#  607|   	retval->capostart    = NULL;
#  608|   	retval->tienote      = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def35]
libmodplug-0.8.9.0/src/load_abc.cpp:607: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  605|   	retval->head         = NULL;
#  606|   	retval->tail         = NULL;
#  607|-> 	retval->capostart    = NULL;
#  608|   	retval->tienote      = NULL;
#  609|   	retval->mute         = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def36]
libmodplug-0.8.9.0/src/load_abc.cpp:608: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  606|   	retval->tail         = NULL;
#  607|   	retval->capostart    = NULL;
#  608|-> 	retval->tienote      = NULL;
#  609|   	retval->mute         = 0;
#  610|   	retval->chan         = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def37]
libmodplug-0.8.9.0/src/load_abc.cpp:609: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  607|   	retval->capostart    = NULL;
#  608|   	retval->tienote      = NULL;
#  609|-> 	retval->mute         = 0;
#  610|   	retval->chan         = 0;
#  611|   	retval->transpose    = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def38]
libmodplug-0.8.9.0/src/load_abc.cpp:610: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  608|   	retval->tienote      = NULL;
#  609|   	retval->mute         = 0;
#  610|-> 	retval->chan         = 0;
#  611|   	retval->transpose    = 0;
#  612|   	retval->volume       = h->track? h->track->volume: 120;

Error: CPPCHECK_WARNING (CWE-476): [#def39]
libmodplug-0.8.9.0/src/load_abc.cpp:611: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  609|   	retval->mute         = 0;
#  610|   	retval->chan         = 0;
#  611|-> 	retval->transpose    = 0;
#  612|   	retval->volume       = h->track? h->track->volume: 120;
#  613|   	retval->slidevoltime = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def40]
libmodplug-0.8.9.0/src/load_abc.cpp:612: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  610|   	retval->chan         = 0;
#  611|   	retval->transpose    = 0;
#  612|-> 	retval->volume       = h->track? h->track->volume: 120;
#  613|   	retval->slidevoltime = 0;
#  614|   	retval->slidevol     = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def41]
libmodplug-0.8.9.0/src/load_abc.cpp:613: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  611|   	retval->transpose    = 0;
#  612|   	retval->volume       = h->track? h->track->volume: 120;
#  613|-> 	retval->slidevoltime = 0;
#  614|   	retval->slidevol     = 0;
#  615|   	retval->legato       = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def42]
libmodplug-0.8.9.0/src/load_abc.cpp:614: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  612|   	retval->volume       = h->track? h->track->volume: 120;
#  613|   	retval->slidevoltime = 0;
#  614|-> 	retval->slidevol     = 0;
#  615|   	retval->legato       = 0;
#  616|   	return retval;

Error: CPPCHECK_WARNING (CWE-476): [#def43]
libmodplug-0.8.9.0/src/load_abc.cpp:615: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  613|   	retval->slidevoltime = 0;
#  614|   	retval->slidevol     = 0;
#  615|-> 	retval->legato       = 0;
#  616|   	return retval;
#  617|   }

Error: COMPILER_WARNING (CWE-195): [#def44]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘ABCTRACK* abc_locate_track(ABCHANDLE*, const char*, int)’
libmodplug-0.8.9.0/src/load_abc.cpp:829:23: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
#  829 |         for( i=0; i+1 < sizeof(vc) && *voice && *voice != ']' && *voice != '%' && !isspace(*voice); voice++ )   // can work with inline voice instructions
#      |                   ~~~~^~~~~~~~~~~~
#  827|   	int i, trans=0, voiceno=0, instrno = 1, channo = 0;
#  828|   	for( ; *voice == ' '; voice++ ) ;	// skip leading spaces
#  829|-> 	for( i=0; i+1 < sizeof(vc) && *voice && *voice != ']' && *voice != '%' && !isspace(*voice); voice++ )	// can work with inline voice instructions
#  830|   		vc[i++] = *voice;
#  831|   	vc[i] = '\0';

Error: COMPILER_WARNING (CWE-195): [#def45]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘void abc_add_chord(const char*, ABCHANDLE*, ABCTRACK*, uint32_t)’
libmodplug-0.8.9.0/src/load_abc.cpp:1499:21: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
# 1499 |         for( i=0; i < sizeof(s) - 1 && p[i] && p[i] != '"' && p[i] != '/' && p[i] != '(' && p[i] != ')' && p[i] != ' '; i++ ) s[i] = p[i];
#      |                   ~~^~~~~~~~~~~~~~~
# 1497|   	}
# 1498|   	d[chordbase] = d[chordnote];
# 1499|-> 	for( i=0; i < sizeof(s) - 1 && p[i] && p[i] != '"' && p[i] != '/' && p[i] != '(' && p[i] != ')' && p[i] != ' '; i++ ) s[i] = p[i];
# 1500|   	s[i] = '\0';
# 1501|   	p = &p[i];

Error: COMPILER_WARNING (CWE-195): [#def46]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘void abc_set_parts(char**, char*)’
libmodplug-0.8.9.0/src/load_abc.cpp:1833:56: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
# 1833 |         for( i=0; p[i] && p[i] != '%' && j < size && i < size; i++ ) {
#      |                                                      ~~^~~~~~
# 1831|   	// now copy bytes from p to *d, taking parens and digits in account
# 1832|   	j = 0;
# 1833|-> 	for( i=0; p[i] && p[i] != '%' && j < size && i < size; i++ ) {
# 1834|   		if( isdigit(p[i]) || isupper(p[i]) || p[i] == '(' || p[i] == ')' ) {
# 1835|   			if( p[i] == ')' ) {

Error: COMPILER_WARNING (CWE-195): [#def47]
libmodplug-0.8.9.0/src/load_abc.cpp:1839:54: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
# 1839 |                                         for( k = n; k<j; k++ ) q[k-1] = q[k];   // shift to the left...
#      |                                                     ~^~
# 1837|   				// q[n+1] to q[j] contains the substring that must be repeated
# 1838|   				if( n > 0 ) {
# 1839|-> 					for( k = n; k<j; k++ ) q[k-1] = q[k];	// shift to the left...
# 1840|   					j--;
# 1841|   				}

Error: CPPCHECK_WARNING (CWE-476): [#def48]
libmodplug-0.8.9.0/src/load_abc.cpp:1872: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: q
# 1870|   		}
# 1871|   	}
# 1872|-> 	q[j] = '\0';
# 1873|   	// remove any left over parens
# 1874|   	for( i=0; i<j; i++ ) {

Error: COMPILER_WARNING (CWE-195): [#def49]
libmodplug-0.8.9.0/src/load_abc.cpp:1874:20: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
# 1874 |         for( i=0; i<j; i++ ) {
#      |                   ~^~
# 1872|   	q[j] = '\0';
# 1873|   	// remove any left over parens
# 1874|-> 	for( i=0; i<j; i++ ) {
# 1875|   		if( q[i] == '(' ) {
# 1876|   			abc_message("Warning: Unbalanced left parens in P: definition %s",p);

Error: CPPCHECK_WARNING (CWE-476): [#def50]
libmodplug-0.8.9.0/src/load_abc.cpp:1875: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: q
# 1873|   	// remove any left over parens
# 1874|   	for( i=0; i<j; i++ ) {
# 1875|-> 		if( q[i] == '(' ) {
# 1876|   			abc_message("Warning: Unbalanced left parens in P: definition %s",p);
# 1877|   			for( k=i; k<j; k++ ) q[k] = q[k+1];

Error: COMPILER_WARNING (CWE-195): [#def51]
libmodplug-0.8.9.0/src/load_abc.cpp:1877:36: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
# 1877 |                         for( k=i; k<j; k++ ) q[k] = q[k+1];
#      |                                   ~^~
# 1875|   		if( q[i] == '(' ) {
# 1876|   			abc_message("Warning: Unbalanced left parens in P: definition %s",p);
# 1877|-> 			for( k=i; k<j; k++ ) q[k] = q[k+1];
# 1878|   			j--;
# 1879|   		}

Error: COMPILER_WARNING: [#def52]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘ABC_Init()’
libmodplug-0.8.9.0/src/load_abc.cpp:2368:39: warning[-Wformat-overflow=]: ‘%ld’ directive writing between 1 and 11 bytes into a region of size 9
# 2368 |                         sprintf(buf,"-%ld",retval->pickrandom+2);
#      |                                       ^~~
libmodplug-0.8.9.0/src/load_abc.cpp:2368:37: note: directive argument in the range [-2147483646, 2147483648]
# 2368 |                         sprintf(buf,"-%ld",retval->pickrandom+2);
#      |                                     ^~~~~~
/usr/include/bits/stdio2.h:30:34: note: ‘__sprintf_chk’ output between 3 and 13 bytes into a destination of size 10
#   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
#      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   31 |                                   __glibc_objsize (__s), __fmt,
#      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   32 |                                   __va_arg_pack ());
#      |                                   ~~~~~~~~~~~~~~~~~
# 2366|   		if( *p == '-' ) {
# 2367|   			retval->pickrandom = atoi(p+1)-1; // xmms preloads the file
# 2368|-> 			sprintf(buf,"-%ld",retval->pickrandom+2);
# 2369|   			setenv(ABC_ENV_NORANDOMPICK, buf, 1);
# 2370|   		}

Error: COMPILER_WARNING: [#def53]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘ABC_Init()’
libmodplug-0.8.9.0/src/load_abc.cpp:2376:31: warning[-Wformat-overflow=]: ‘%ld’ directive writing between 1 and 11 bytes into a region of size 9
# 2376 |                 sprintf(buf,"-%ld",retval->pickrandom); // xmms preloads the file
#      |                               ^~~
libmodplug-0.8.9.0/src/load_abc.cpp:2376:29: note: directive argument in the range [-2147483647, 2147483647]
# 2376 |                 sprintf(buf,"-%ld",retval->pickrandom); // xmms preloads the file
#      |                             ^~~~~~
/usr/include/bits/stdio2.h:30:34: note: ‘__sprintf_chk’ output between 3 and 13 bytes into a destination of size 10
#   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
#      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   31 |                                   __glibc_objsize (__s), __fmt,
#      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   32 |                                   __va_arg_pack ());
#      |                                   ~~~~~~~~~~~~~~~~~
# 2374|   		retval->pickrandom = 1+(int)(10000.0*random()/(RAND_MAX+1.0));
# 2375|   		// can handle pickin' from songbooks with 10.000 songs
# 2376|-> 		sprintf(buf,"-%ld",retval->pickrandom); // xmms preloads the file
# 2377|   		setenv(ABC_ENV_NORANDOMPICK, buf, 1);
# 2378|   	}

Error: COMPILER_WARNING (CWE-195): [#def54]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘int abc_MIDI_drum(const char*, ABCHANDLE*)’
libmodplug-0.8.9.0/src/load_abc.cpp:2979:41: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
# 2979 |                 if( !isdigit(*p) && len < sizeof(h->drum)-1 ) {
#      |                                     ~~~~^~~~~~~~~~~~~~~~~~~
# 2977|   		if( !strchr("dz0123456789",*p) ) break;
# 2978|   		*q++ = *p; len++;
# 2979|-> 		if( !isdigit(*p) && len < sizeof(h->drum)-1 ) {
# 2980|   			if( !isdigit(p[1]) ) { *q++ = '1'; len ++; }
# 2981|   			n++; // count the silences too....

Error: COMPILER_WARNING (CWE-195): [#def55]
libmodplug-0.8.9.0/src/load_abc.cpp:2983:25: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
# 2983 |                 if (len >= sizeof(h->drum)-1) {
#      |                     ~~~~^~~~~~~~~~~~~~~~~~~~
# 2981|   			n++; // count the silences too....
# 2982|   		}
# 2983|-> 		if (len >= sizeof(h->drum)-1) {
# 2984|   			// consume the rest of the input
# 2985|   			// definitely enough "drum last state" stored.

Error: COMPILER_WARNING (CWE-195): [#def56]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘int abc_MIDI_gchord(const char*, ABCHANDLE*)’
libmodplug-0.8.9.0/src/load_abc.cpp:3033:41: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
# 3033 |                 if( !isdigit(*p) && len < sizeof(h->gchord)-1 && !isdigit(p[1]) ) { *q++ = '1'; len ++; }
#      |                                     ~~~~^~~~~~~~~~~~~~~~~~~~~
# 3031|   		if( !strchr("fbcz0123456789ghijGHIJ",*p) ) break;
# 3032|   		*q++ = *p; len++;
# 3033|-> 		if( !isdigit(*p) && len < sizeof(h->gchord)-1 && !isdigit(p[1]) ) { *q++ = '1'; len ++; }
# 3034|   		if (len >= sizeof(h->gchord)-1) {
# 3035|   			// consume the rest of the input

Error: COMPILER_WARNING (CWE-195): [#def57]
libmodplug-0.8.9.0/src/load_abc.cpp:3034:25: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
# 3034 |                 if (len >= sizeof(h->gchord)-1) {
#      |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~
# 3032|   		*q++ = *p; len++;
# 3033|   		if( !isdigit(*p) && len < sizeof(h->gchord)-1 && !isdigit(p[1]) ) { *q++ = '1'; len ++; }
# 3034|-> 		if (len >= sizeof(h->gchord)-1) {
# 3035|   			// consume the rest of the input
# 3036|   			// definitely enough "drum last state" stored.

Error: COMPILER_WARNING (CWE-195): [#def58]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In function ‘void abc_metric_gchord(ABCHANDLE*, int, int)’
libmodplug-0.8.9.0/src/load_abc.cpp:3080:34: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
# 3080 |                         if (dest >= sizeof(h->gchord))
#      |                             ~~~~~^~~~~~~~~~~~~~~~~~~~
# 3078|   			if( mdiv == 8 )	dest = mlen*2;
# 3079|   			else dest = mlen*4;
# 3080|-> 			if (dest >= sizeof(h->gchord))
# 3081|   				dest = sizeof(h->gchord) - 1;
# 3082|   			h->gchord[dest] = '\0';

Error: COMPILER_WARNING (CWE-195): [#def59]
libmodplug-0.8.9.0/src/load_abc.cpp: scope_hint: In member function ‘BOOL CSoundFile::ReadABC(const uint8_t*, DWORD)’
libmodplug-0.8.9.0/src/load_abc.cpp:3935:64: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘DWORD’ {aka ‘unsigned int’}
# 3935 |                                         if (mmstack[mmsp]->pos < dwMemLength) {
#      |                                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
# 3933|   				if( abcstate != INSKIPFORX ) {
# 3934|   					char *pm = p;
# 3935|-> 					if (mmstack[mmsp]->pos < dwMemLength) {
# 3936|   						pm = abc_continuated(h, mmstack[mmsp], p);
# 3937|   						abc_new_macro(h, pm+2);

Error: COMPILER_WARNING: [#def60]
libmodplug-0.8.9.0/src/load_ams.cpp: scope_hint: In member function ‘BOOL CSoundFile::ReadAMS(LPCBYTE, DWORD)’
libmodplug-0.8.9.0/src/load_ams.cpp:48:14: warning[-Wunused-but-set-variable=]: variable ‘pkinf’ set but not used
#   48 |         BYTE pkinf[MAX_SAMPLES];
#      |              ^~~~~
#   46|   //-----------------------------------------------------------
#   47|   {
#   48|-> 	BYTE pkinf[MAX_SAMPLES];
#   49|   	AMSFILEHEADER *pfh = (AMSFILEHEADER *)lpStream;
#   50|   	DWORD dwMemPos;

Error: COMPILER_WARNING (CWE-483): [#def61]
libmodplug-0.8.9.0/src/load_dmf.cpp: scope_hint: In member function ‘BOOL CSoundFile::ReadDMF(const BYTE*, DWORD)’
libmodplug-0.8.9.0/src/load_dmf.cpp:282:81: warning[-Wmisleading-indentation]: this ‘else’ clause does not guard...
#  282 |                                                                                 else if (!cmd.note) { cmd.note = 0xfe; } break;
#      |                                                                                 ^~~~
libmodplug-0.8.9.0/src/load_dmf.cpp:282:122: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
#  282 |                                                                                 else if (!cmd.note) { cmd.note = 0xfe; } break;
#      |                                                                                                                          ^~~~~
#  280|   								// 12: Note cut
#  281|   								case 12: if (eval & 0xe0) { cmd.command = CMD_S3MCMDEX; cmd.param = (eval>>5)|0xc0; }
#  282|-> 										else if (!cmd.note) { cmd.note = 0xfe; } break;
#  283|   								#ifdef DMFLOG
#  284|   								default: Log("FX2: %02X.%02X\n", efx, eval);

Error: COMPILER_WARNING: [#def62]
libmodplug-0.8.9.0/src/load_it.cpp: scope_hint: In member function ‘BOOL CSoundFile::ReadIT(const BYTE*, DWORD)’
libmodplug-0.8.9.0/src/load_it.cpp:166:27: warning[-Wunused-but-set-variable=]: variable ‘channels_used’ set but not used
#  166 |         BYTE chnmask[64], channels_used[64];
#      |                           ^~~~~~~~~~~~~
#  164|   	DWORD smppos[MAX_SAMPLES];
#  165|   	DWORD patpos[MAX_PATTERNS];
#  166|-> 	BYTE chnmask[64], channels_used[64];
#  167|   	MODCOMMAND lastvalue[64];
#  168|   

Error: COMPILER_WARNING: [#def63]
libmodplug-0.8.9.0/src/load_it.cpp: scope_hint: In function ‘void ITUnpack8Bit(signed char*, DWORD, LPBYTE, DWORD, BOOL)’
libmodplug-0.8.9.0/src/load_it.cpp:1221:15: warning[-Wunused-but-set-variable=]: variable ‘wHdr’ set but not used
# 1221 |         DWORD wHdr = 0;
#      |               ^~~~
# 1219|   	signed char *pDst = pSample;
# 1220|   	LPBYTE pSrc = lpMemFile;
# 1221|-> 	DWORD wHdr = 0;
# 1222|   	DWORD wCount = 0;
# 1223|   	DWORD bitbuf = 0;

Error: COMPILER_WARNING: [#def64]
libmodplug-0.8.9.0/src/load_it.cpp: scope_hint: In function ‘void ITUnpack16Bit(signed char*, DWORD, LPBYTE, DWORD, BOOL)’
libmodplug-0.8.9.0/src/load_it.cpp:1303:15: warning[-Wunused-but-set-variable=]: variable ‘wHdr’ set but not used
# 1303 |         DWORD wHdr = 0;
#      |               ^~~~
# 1301|   	signed short *pDst = (signed short *)pSample;
# 1302|   	LPBYTE pSrc = lpMemFile;
# 1303|-> 	DWORD wHdr = 0;
# 1304|   	DWORD wCount = 0;
# 1305|   	DWORD bitbuf = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def65]
libmodplug-0.8.9.0/src/load_mid.cpp:262: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  260|   
#  261|       retval = (MIDEVENT *)_mm_calloc(h->trackhandle, 1,sizeof(MIDEVENT));
#  262|-> 		retval->next      = NULL;
#  263|       retval->tracktick = h->tracktime;
#  264|   		retval->flg       = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def66]
libmodplug-0.8.9.0/src/load_mid.cpp:263: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  261|       retval = (MIDEVENT *)_mm_calloc(h->trackhandle, 1,sizeof(MIDEVENT));
#  262|   		retval->next      = NULL;
#  263|->     retval->tracktick = h->tracktime;
#  264|   		retval->flg       = 0;
#  265|   		retval->note      = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def67]
libmodplug-0.8.9.0/src/load_mid.cpp:264: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  262|   		retval->next      = NULL;
#  263|       retval->tracktick = h->tracktime;
#  264|-> 		retval->flg       = 0;
#  265|   		retval->note      = 0;
#  266|   		retval->volume    = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def68]
libmodplug-0.8.9.0/src/load_mid.cpp:265: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  263|       retval->tracktick = h->tracktime;
#  264|   		retval->flg       = 0;
#  265|-> 		retval->note      = 0;
#  266|   		retval->volume    = 0;
#  267|   		retval->smpno     = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def69]
libmodplug-0.8.9.0/src/load_mid.cpp:266: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  264|   		retval->flg       = 0;
#  265|   		retval->note      = 0;
#  266|-> 		retval->volume    = 0;
#  267|   		retval->smpno     = 0;
#  268|   		retval->fx        = none;

Error: CPPCHECK_WARNING (CWE-476): [#def70]
libmodplug-0.8.9.0/src/load_mid.cpp:267: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  265|   		retval->note      = 0;
#  266|   		retval->volume    = 0;
#  267|-> 		retval->smpno     = 0;
#  268|   		retval->fx        = none;
#  269|   		retval->fxparam   = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def71]
libmodplug-0.8.9.0/src/load_mid.cpp:268: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  266|   		retval->volume    = 0;
#  267|   		retval->smpno     = 0;
#  268|-> 		retval->fx        = none;
#  269|   		retval->fxparam   = 0;
#  270|       return retval;

Error: CPPCHECK_WARNING (CWE-476): [#def72]
libmodplug-0.8.9.0/src/load_mid.cpp:269: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  267|   		retval->smpno     = 0;
#  268|   		retval->fx        = none;
#  269|-> 		retval->fxparam   = 0;
#  270|       return retval;
#  271|   }

Error: CPPCHECK_WARNING (CWE-476): [#def73]
libmodplug-0.8.9.0/src/load_mid.cpp:279: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  277|   	MIDTRACK *retval;
#  278|   	retval = (MIDTRACK *)_mm_calloc(h->trackhandle, 1,sizeof(MIDTRACK));
#  279|-> 	retval->next       = NULL;
#  280|   	retval->vpos       = pos;
#  281|   	retval->instr      = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def74]
libmodplug-0.8.9.0/src/load_mid.cpp:280: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  278|   	retval = (MIDTRACK *)_mm_calloc(h->trackhandle, 1,sizeof(MIDTRACK));
#  279|   	retval->next       = NULL;
#  280|-> 	retval->vpos       = pos;
#  281|   	retval->instr      = 1;
#  282|   	retval->chan       = mch;

Error: CPPCHECK_WARNING (CWE-476): [#def75]
libmodplug-0.8.9.0/src/load_mid.cpp:281: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  279|   	retval->next       = NULL;
#  280|   	retval->vpos       = pos;
#  281|-> 	retval->instr      = 1;
#  282|   	retval->chan       = mch;
#  283|   	retval->head       = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def76]
libmodplug-0.8.9.0/src/load_mid.cpp:282: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  280|   	retval->vpos       = pos;
#  281|   	retval->instr      = 1;
#  282|-> 	retval->chan       = mch;
#  283|   	retval->head       = NULL;
#  284|   	retval->tail       = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def77]
libmodplug-0.8.9.0/src/load_mid.cpp:283: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  281|   	retval->instr      = 1;
#  282|   	retval->chan       = mch;
#  283|-> 	retval->head       = NULL;
#  284|   	retval->tail       = NULL;
#  285|   	retval->workevent  = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def78]
libmodplug-0.8.9.0/src/load_mid.cpp:284: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  282|   	retval->chan       = mch;
#  283|   	retval->head       = NULL;
#  284|-> 	retval->tail       = NULL;
#  285|   	retval->workevent  = NULL;
#  286|   	retval->vtracktick = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def79]
libmodplug-0.8.9.0/src/load_mid.cpp:285: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  283|   	retval->head       = NULL;
#  284|   	retval->tail       = NULL;
#  285|-> 	retval->workevent  = NULL;
#  286|   	retval->vtracktick = 0;
#  287|   	retval->volume     = h->track? h->track->volume: 120;

Error: CPPCHECK_WARNING (CWE-476): [#def80]
libmodplug-0.8.9.0/src/load_mid.cpp:286: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  284|   	retval->tail       = NULL;
#  285|   	retval->workevent  = NULL;
#  286|-> 	retval->vtracktick = 0;
#  287|   	retval->volume     = h->track? h->track->volume: 120;
#  288|   	retval->balance    = 64;

Error: CPPCHECK_WARNING (CWE-476): [#def81]
libmodplug-0.8.9.0/src/load_mid.cpp:287: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  285|   	retval->workevent  = NULL;
#  286|   	retval->vtracktick = 0;
#  287|-> 	retval->volume     = h->track? h->track->volume: 120;
#  288|   	retval->balance    = 64;
#  289|   	return retval;

Error: CPPCHECK_WARNING (CWE-476): [#def82]
libmodplug-0.8.9.0/src/load_mid.cpp:288: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: retval
#  286|   	retval->vtracktick = 0;
#  287|   	retval->volume     = h->track? h->track->volume: 120;
#  288|-> 	retval->balance    = 64;
#  289|   	return retval;
#  290|   }

Error: COMPILER_WARNING: [#def83]
libmodplug-0.8.9.0/src/load_mid.cpp: scope_hint: In member function ‘CSoundFile::ReadMID(unsigned char const*, unsigned int) [clone .part.0]’
libmodplug-0.8.9.0/src/load_mid.cpp:1078:48: warning[-Wformat-overflow=]: ‘__sprintf_chk’ may write a terminating nul past the end of the destination
# 1078 |                 sprintf(info,"%ld > %ld note %d", (long)ton, (long)toff, n);
#      |                                                ^
/usr/include/bits/stdio2.h:30:34: note: ‘__sprintf_chk’ output between 13 and 33 bytes into a destination of size 32
#   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
#      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   31 |                                   __glibc_objsize (__s), __fmt,
#      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   32 |                                   __va_arg_pack ());
#      |                                   ~~~~~~~~~~~~~~~~~
# 1076|   	if( ton > toff ) {
# 1077|   		char info[32];
# 1078|-> 		sprintf(info,"%ld > %ld note %d", (long)ton, (long)toff, n);
# 1079|   		mid_message("drum track ends with note on (%s)", info);
# 1080|   	}

Error: COMPILER_WARNING: [#def84]
libmodplug-0.8.9.0/src/load_mid.cpp: scope_hint: In member function ‘CSoundFile::ReadMID(unsigned char const*, unsigned int) [clone .part.0]’
libmodplug-0.8.9.0/src/load_mid.cpp:1132:52: warning[-Wformat-overflow=]: ‘ note ’ directive writing 6 bytes into a region of size between 4 and 24
# 1132 |                 sprintf(info,"channel %d, %ld > %ld note %d", tp->chan + 1, (long)ton, (long)toff, n);
#      |                                                    ^~~~~~
libmodplug-0.8.9.0/src/load_mid.cpp:1132:30: note: directive argument in the range [0, 255]
# 1132 |                 sprintf(info,"channel %d, %ld > %ld note %d", tp->chan + 1, (long)ton, (long)toff, n);
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/bits/stdio2.h:30:34: note: ‘__sprintf_chk’ output between 24 and 46 bytes into a destination of size 40
#   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
#      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   31 |                                   __glibc_objsize (__s), __fmt,
#      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   32 |                                   __va_arg_pack ());
#      |                                   ~~~~~~~~~~~~~~~~~
# 1130|   	if( ton > toff ) {
# 1131|   		char info[40];
# 1132|-> 		sprintf(info,"channel %d, %ld > %ld note %d", tp->chan + 1, (long)ton, (long)toff, n);
# 1133|   		mid_message("melody track ends with note on (%s)", info);
# 1134|   	}

Error: COMPILER_WARNING (CWE-483): [#def85]
libmodplug-0.8.9.0/src/load_mod.cpp: scope_hint: In member function ‘void CSoundFile::ConvertModCommand(MODCOMMAND*) const’
libmodplug-0.8.9.0/src/load_mod.cpp:42:33: warning[-Wmisleading-indentation]: this ‘if’ clause does not guard...
#   42 |                                 if ((param == 0xFF) && (m_nSamples == 15)) command = 0; break;
#      |                                 ^~
libmodplug-0.8.9.0/src/load_mod.cpp:42:89: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
#   42 |                                 if ((param == 0xFF) && (m_nSamples == 15)) command = 0; break;
#      |                                                                                         ^~~~~
#   40|   	case 0x0E:	command = CMD_MODCMDEX; break;
#   41|   	case 0x0F:	command = (param <= (UINT)((m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) ? 0x1F : 0x20)) ? CMD_SPEED : CMD_TEMPO;
#   42|-> 				if ((param == 0xFF) && (m_nSamples == 15)) command = 0; break;
#   43|   	// Extension for XM extended effects
#   44|   	case 'G' - 55:	command = CMD_GLOBALVOLUME; break;

Error: COMPILER_WARNING: [#def86]
libmodplug-0.8.9.0/src/load_okt.cpp: scope_hint: In member function ‘BOOL CSoundFile::ReadOKT(const BYTE*, DWORD)’
libmodplug-0.8.9.0/src/load_okt.cpp:46:28: warning[-Wunused-but-set-variable=]: variable ‘npatterns’ set but not used
#   46 |         UINT nsamples = 0, npatterns = 0, norders = 0;
#      |                            ^~~~~~~~~
#   44|   	const OKTFILEHEADER *pfh = (OKTFILEHEADER *)lpStream;
#   45|   	DWORD dwMemPos = sizeof(OKTFILEHEADER);
#   46|-> 	UINT nsamples = 0, npatterns = 0, norders = 0;
#   47|   
#   48|   	if ((!lpStream) || (dwMemLength < 1024)) return FALSE;

Error: COMPILER_WARNING (CWE-252): [#def87]
libmodplug-0.8.9.0/src/load_pat.cpp: scope_hint: In function ‘void pat_init_patnames()’
libmodplug-0.8.9.0/src/load_pat.cpp:281:54: warning[-Wunused-result]: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’
#  281 | #define _mm_fgets(f,buf,sz)                     fgets(buf,sz,f)
#      |                                                 ~~~~~^~~~~~~~~~
libmodplug-0.8.9.0/src/load_pat.cpp:387:25: note: in expansion of macro ‘_mm_fgets’
#  387 |                         _mm_fgets(mmcfg, line, PATH_MAX);
#      |                         ^~~~~~~~~
#  279|   #define MMSTREAM				FILE
#  280|   #define _mm_fopen(name,mode)			fopen(name,mode)
#  281|-> #define _mm_fgets(f,buf,sz)			fgets(buf,sz,f)
#  282|   #define _mm_fseek(f,pos,whence)			fseek(f,pos,whence)
#  283|   #define _mm_ftell(f)				ftell(f)

Error: COMPILER_WARNING (CWE-252): [#def88]
libmodplug-0.8.9.0/src/load_pat.cpp: scope_hint: In function ‘void pat_read_waveheader(FILE*, WaveHeader*, int)’
libmodplug-0.8.9.0/src/load_pat.cpp:284:54: warning[-Wunused-result]: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’
#  284 | #define _mm_read_UBYTES(buf,sz,f)               fread(buf,sz,1,f)
#      |                                                 ~~~~~^~~~~~~~~~~~
libmodplug-0.8.9.0/src/load_pat.cpp:517:33: note: in expansion of macro ‘_mm_read_UBYTES’
#  517 |                                 _mm_read_UBYTES((BYTE *)hw, sizeof(WaveHeader), mmpat);
#      |                                 ^~~~~~~~~~~~~~~
#  282|   #define _mm_fseek(f,pos,whence)			fseek(f,pos,whence)
#  283|   #define _mm_ftell(f)				ftell(f)
#  284|-> #define _mm_read_UBYTES(buf,sz,f)		fread(buf,sz,1,f)
#  285|   #define _mm_read_SBYTES(buf,sz,f)		fread(buf,sz,1,f)
#  286|   #define _mm_feof(f)				feof(f)

Error: COMPILER_WARNING (CWE-252): [#def89]
libmodplug-0.8.9.0/src/load_pat.cpp: scope_hint: In function ‘void pat_readpat(int, char*, int)’
libmodplug-0.8.9.0/src/load_pat.cpp:285:54: warning[-Wunused-result]: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’
#  285 | #define _mm_read_SBYTES(buf,sz,f)               fread(buf,sz,1,f)
#      |                                                 ~~~~~^~~~~~~~~~~~
libmodplug-0.8.9.0/src/load_pat.cpp:695:9: note: in expansion of macro ‘_mm_read_SBYTES’
#  695 |         _mm_read_SBYTES(dest, num, mmpat);
#      |         ^~~~~~~~~~~~~~~
#  283|   #define _mm_ftell(f)				ftell(f)
#  284|   #define _mm_read_UBYTES(buf,sz,f)		fread(buf,sz,1,f)
#  285|-> #define _mm_read_SBYTES(buf,sz,f)		fread(buf,sz,1,f)
#  286|   #define _mm_feof(f)				feof(f)
#  287|   #define _mm_fclose(f)				fclose(f)

Error: COMPILER_WARNING: [#def90]
libmodplug-0.8.9.0/src/load_pat.cpp: scope_hint: In function ‘pat_init_patnames’
libmodplug-0.8.9.0/src/load_pat.cpp:373:16: warning[-Wstringop-truncation]: ‘strncpy’ output may be truncated copying 4095 bytes from a string of length 4095
#  373 |         strncpy(cfgsources[0], timiditycfg, PATH_MAX - 1);
#      |                ^
#  371|   		strcat(pathforpat, "/instruments");
#  372|   	}
#  373|-> 	strncpy(cfgsources[0], timiditycfg, PATH_MAX - 1);
#  374|   	nsources = 1;
#  375|   

Error: COMPILER_WARNING: [#def91]
libmodplug-0.8.9.0/src/load_pat.cpp:1026:24: warning[-Wstringop-truncation]: ‘strncpy’ output may be truncated copying 31 bytes from a string of length 31
# 1026 |                 strncpy(s, hw.reserved, 32);
#      |                        ^
# 1024|   	}
# 1025|   	if( hw.reserved[0] )
# 1026|-> 		strncpy(s, hw.reserved, 32);
# 1027|   	else
# 1028|   		strncpy(s, midipat[gm-1], 32);

Error: COMPILER_WARNING: [#def92]
libmodplug-0.8.9.0/src/load_pat.cpp: scope_hint: In function ‘PAT_Load_Instruments’
libmodplug-0.8.9.0/src/load_pat.cpp:1028:24: warning[-Wstringop-truncation]: ‘strncpy’ output may be truncated copying 31 bytes from a string of length 782335
# 1028 |                 strncpy(s, midipat[gm-1], 32);
#      |                        ^
# 1026|   		strncpy(s, hw.reserved, 32);
# 1027|   	else
# 1028|-> 		strncpy(s, midipat[gm-1], 32);
# 1029|   	s[31] = '\0';
# 1030|   	memset(d->name, 0, 32);

Error: COMPILER_WARNING: [#def93]
libmodplug-0.8.9.0/src/load_pat.cpp: scope_hint: In function ‘PATsample(CSoundFile*, _MODINSTRUMENT*, int, int)’
libmodplug-0.8.9.0/src/load_pat.cpp:1066:16: warning[-Wstringop-truncation]: ‘__strncpy_chk’ output may be truncated copying 31 bytes from a string of length 255
# 1066 |         strncpy(cs->m_szNames[smp], s, 32-1);
#      |                ^
# 1064|   	s[31] = '\0';
# 1065|   	memset(cs->m_szNames[smp], 0, 32);
# 1066|-> 	strncpy(cs->m_szNames[smp], s, 32-1);
# 1067|   	q->nGlobalVol = 64;
# 1068|   	q->nPan       = 128;

Error: COMPILER_WARNING: [#def94]
libmodplug-0.8.9.0/src/load_psm.cpp: scope_hint: In member function ‘BOOL CSoundFile::ReadPSM(LPCBYTE, DWORD)’
libmodplug-0.8.9.0/src/load_psm.cpp:103:15: warning[-Wunused-but-set-variable=]: variable ‘smpnames’ set but not used
#  103 |         DWORD smpnames[MAX_SAMPLES];
#      |               ^~~~~~~~
#  101|   	PSMCHUNK *pfh = (PSMCHUNK *)lpStream;
#  102|   	DWORD dwMemPos, dwSongPos;
#  103|-> 	DWORD smpnames[MAX_SAMPLES];
#  104|   	DWORD patptrs[MAX_PATTERNS];
#  105|   	BYTE samplemap[MAX_SAMPLES];

Error: COMPILER_WARNING (CWE-704): [#def95]
libmodplug-0.8.9.0/src/snd_dsp.cpp:102:12: warning[-Wlto-type-mismatch]: type of 'MixSoundBuffer' does not match original declaration
#  102 | extern int MixSoundBuffer[MIXBUFFERSIZE*2];
#      |            ^
libmodplug-0.8.9.0/src/fastmix.cpp:17:5: note: array types have different bounds
#   17 | int MixSoundBuffer[MIXBUFFERSIZE*4];
#      |     ^
libmodplug-0.8.9.0/src/fastmix.cpp:17:5: note: 'MixSoundBuffer' was previously declared here
#  100|   
#  101|   // Access the main temporary mix buffer directly: avoids an extra pointer
#  102|-> extern int MixSoundBuffer[MIXBUFFERSIZE*2];
#  103|   //cextern int MixReverbBuffer[MIXBUFFERSIZE*2];
#  104|   extern int MixReverbBuffer[MIXBUFFERSIZE*2];

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-175.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibmodplug-0.8.9.0-29.fc44
store-results-to/tmp/tmp7gp9fbn9/libmodplug-0.8.9.0-29.fc44.tar.xz
time-created2026-08-03 17:32:08
time-finished2026-08-03 17:34:10
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp7gp9fbn9/libmodplug-0.8.9.0-29.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp7gp9fbn9/libmodplug-0.8.9.0-29.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9