The file drivers are one of the few things that can be accessed before LOG is set up, guard all accesses.
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#define Trace(args...) if( LOG ) LOG->Trace( args ); else fprintf( stderr, args )
|
||||
|
||||
RageFileObjInflate::RageFileObjInflate( RageFileBasic *pFile, int iUncompressedSize )
|
||||
{
|
||||
m_bFileOwned = false;
|
||||
@@ -37,7 +39,7 @@ RageFileObjInflate::RageFileObjInflate( RageFileBasic *pFile, int iUncompressedS
|
||||
if( err == Z_MEM_ERROR )
|
||||
RageException::Throw( "inflateInit2( %i ): out of memory.", -MAX_WBITS );
|
||||
if( err != Z_OK )
|
||||
LOG->Trace( "Huh? inflateInit2() err = %i", err );
|
||||
Trace( "Huh? inflateInit2() err = %i", err );
|
||||
|
||||
decomp_buf_ptr = decomp_buf;
|
||||
m_iFilePos = 0;
|
||||
@@ -73,7 +75,7 @@ RageFileObjInflate::~RageFileObjInflate()
|
||||
|
||||
int err = inflateEnd( m_pInflate );
|
||||
if( err != Z_OK )
|
||||
LOG->Trace( "Huh? inflateEnd() err = %i", err );
|
||||
Trace( "Huh? inflateEnd() err = %i", err );
|
||||
|
||||
delete m_pInflate;
|
||||
}
|
||||
@@ -128,7 +130,7 @@ int RageFileObjInflate::ReadInternal( void *buf, size_t bytes )
|
||||
case Z_OK:
|
||||
break;
|
||||
default:
|
||||
LOG->Trace( "Huh? inflate err %i", err );
|
||||
Trace( "Huh? inflate err %i", err );
|
||||
}
|
||||
|
||||
const int used = (char *)m_pInflate->next_in - decomp_buf_ptr;
|
||||
@@ -205,7 +207,7 @@ RageFileObjDeflate::RageFileObjDeflate( RageFileBasic *pFile )
|
||||
if( err == Z_MEM_ERROR )
|
||||
RageException::Throw( "inflateInit2( %i ): out of memory.", -MAX_WBITS );
|
||||
if( err != Z_OK )
|
||||
LOG->Trace( "Huh? inflateInit2() err = %i", err );
|
||||
Trace( "Huh? inflateInit2() err = %i", err );
|
||||
|
||||
}
|
||||
|
||||
@@ -218,7 +220,7 @@ RageFileObjDeflate::~RageFileObjDeflate()
|
||||
|
||||
int err = deflateEnd( m_pDeflate );
|
||||
if( err != Z_OK )
|
||||
LOG->Trace( "Huh? deflateEnd() err = %i", err );
|
||||
Trace( "Huh? deflateEnd() err = %i", err );
|
||||
|
||||
delete m_pDeflate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user