mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix garbage IMC files
This commit is contained in:
parent
4121baac33
commit
f915b73f8d
1 changed files with 3 additions and 3 deletions
|
|
@ -220,15 +220,15 @@ public unsafe class ImcFile : MetaBaseFile
|
|||
public void Replace( ResourceHandle* resource )
|
||||
{
|
||||
var (data, length) = resource->GetData();
|
||||
var newData = Penumbra.MetaFileManager.AllocateDefaultMemory( Length, 8 );
|
||||
var newData = Penumbra.MetaFileManager.AllocateDefaultMemory( ActualLength, 8 );
|
||||
if( newData == null )
|
||||
{
|
||||
PluginLog.Error("Could not replace loaded IMC data at 0x{Data:X}, allocation failed." );
|
||||
return;
|
||||
}
|
||||
Functions.MemCpyUnchecked( newData, Data, Length );
|
||||
Functions.MemCpyUnchecked( newData, Data, ActualLength );
|
||||
|
||||
Penumbra.MetaFileManager.Free( data, length );
|
||||
resource->SetData( ( IntPtr )newData, Length );
|
||||
resource->SetData( ( IntPtr )newData, ActualLength );
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue