pull/30/merge
Pavel Gushchin 9 years ago committed by GitHub
commit 35970acb13

@ -339,8 +339,13 @@ BOOL CSoundFile::Destroy()
MODCOMMAND *CSoundFile::AllocatePattern(UINT rows, UINT nchns)
//------------------------------------------------------------
{
try {
MODCOMMAND *p = new MODCOMMAND[rows*nchns];
if (p) memset(p, 0, rows*nchns*sizeof(MODCOMMAND));
memset(p, 0, rows*nchns*sizeof(MODCOMMAND));
}
catch (std::bad_alloc& ba) {
}
return p;
}
@ -1777,8 +1782,15 @@ BOOL CSoundFile::SetPatternName(UINT nPat, LPCSTR lpszName)
{
if (!lpszName[0]) return TRUE;
UINT len = (nPat+1)*MAX_PATTERNNAME;
char *p = new char[len];
if (!p) return FALSE;
char *p;
try {
p = new char[len];
}
catch (std::bad_alloc& ba) {
return FALSE;
}
memset(p, 0, len);
if (m_lpszPatternNames)
{

@ -13,6 +13,8 @@
#ifndef __SNDFILE_H
#define __SNDFILE_H
#include <new>
#ifdef UNDER_CE
int _strnicmp(const char *str1,const char *str2, int n);
#endif

Loading…
Cancel
Save