add missing copy ctor (fixes potential crash; reproduced in a test case but may not actually manifest anywhere)
This commit is contained in:
@@ -15,6 +15,28 @@ RageFileObj::RageFileObj()
|
||||
m_iCRC32 = 0;
|
||||
}
|
||||
|
||||
RageFileObj::RageFileObj( const RageFileObj &cpy ):
|
||||
RageFileBasic(cpy)
|
||||
{
|
||||
/* If the original file has a buffer, copy it. */
|
||||
if( cpy.m_pBuffer != NULL )
|
||||
{
|
||||
m_pBuffer = new char[BSIZE];
|
||||
memcpy( m_pBuffer, cpy.m_pBuffer, BSIZE );
|
||||
|
||||
int iOffsetIntoBuffer = cpy.m_pBuf - cpy.m_pBuffer;
|
||||
m_pBuf = m_pBuffer + iOffsetIntoBuffer;
|
||||
}
|
||||
else
|
||||
m_pBuffer = NULL;
|
||||
|
||||
m_iBufAvail = cpy.m_iBufAvail;
|
||||
m_bEOF = cpy.m_bEOF;
|
||||
m_iFilePos = cpy.m_iFilePos;
|
||||
m_bCRC32Enabled = cpy.m_bCRC32Enabled;
|
||||
m_iCRC32 = cpy.m_iCRC32;
|
||||
}
|
||||
|
||||
RageFileObj::~RageFileObj()
|
||||
{
|
||||
delete [] m_pBuffer;
|
||||
|
||||
@@ -59,6 +59,7 @@ class RageFileObj: public RageFileBasic
|
||||
{
|
||||
public:
|
||||
RageFileObj();
|
||||
RageFileObj( const RageFileObj &cpy );
|
||||
virtual ~RageFileObj();
|
||||
|
||||
virtual CString GetError() const { return m_sError; }
|
||||
|
||||
Reference in New Issue
Block a user