mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
Fixes & Cleanup
This commit is contained in:
@ -10,7 +10,7 @@ namespace AssetStudio
|
||||
public static Image<Bgra32> ConvertToImage(this Texture2D m_Texture2D, bool flip)
|
||||
{
|
||||
var converter = new Texture2DConverter(m_Texture2D);
|
||||
var buff = BigArrayPool<byte>.Shared.Rent(m_Texture2D.m_Width * m_Texture2D.m_Height * 4);
|
||||
var buff = BigArrayPool<byte>.Shared.Rent(converter.outPutSize);
|
||||
try
|
||||
{
|
||||
if (converter.DecodeTexture2D(buff))
|
||||
@ -26,7 +26,7 @@ namespace AssetStudio
|
||||
}
|
||||
finally
|
||||
{
|
||||
BigArrayPool<byte>.Shared.Return(buff);
|
||||
BigArrayPool<byte>.Shared.Return(buff, clearArray: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user