Skip to content

Commit a7e6524

Browse files
committed
Fixed crash in automatic TXD resizing
1 parent 403fbb4 commit a7e6524

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

MTA10/game_sa/CRenderWareSA.TxdRightSizing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ bool CRenderWareSA::RightSizeTxd( const CBuffer& inTxd, const SString& strOutTxd
4848
// read the txd
4949
RwTexDictionary* pTxd = RwTexDictionaryGtaStreamRead( pStream );
5050
RwStreamClose( pStream, NULL );
51-
51+
if ( !pTxd )
52+
return false;
5253

5354
//
5455
// Process each texture in the txd

MTA10/mods/shared_logic/CClientTXD.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ bool CClientTXD::LoadFileData( CBuffer& outBuffer )
198198
// Yes
199199
outBuffer.LoadFromFile( strShrunkFilename );
200200
FileAppend( strShrunkFilename, GenerateSha256HexStringFromFile( strShrunkFilename ) );
201-
AddReportLog( 9400, SString( "RightSized %s(%s) from %d to %d"
201+
AddReportLog( 9400, SString( "RightSized %s(%s) from %d KB => %d KB"
202202
, *ExtractFilename( m_strFilename )
203203
, *strLargeSha256.Left( 8 )
204-
, (uint)FileSize( m_strFilename )
205-
, outBuffer.GetSize()
204+
, (uint)FileSize( m_strFilename ) / 1024
205+
, outBuffer.GetSize() / 1024
206206
) );
207207
}
208208
else

0 commit comments

Comments
 (0)