Skip to content

Commit 6d7d1c6

Browse files
committed
Added 'source' parameter for 'ApplyStudy.'
1 parent 3766575 commit 6d7d1c6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

LibIPS.NET/LibIpsNet.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public IpsError Study(Stream patch, IpsStudy study)
9898
}
9999

100100
}
101-
public IpsError ApplyStudy(Stream patch, IpsStudy study, Stream target)
101+
public IpsError ApplyStudy(Stream patch, IpsStudy study, Stream source, Stream target)
102102
{
103-
long targetLength = target.Length;
103+
source.CopyTo(target);
104104
if (study.Error == IpsError.IpsInvalid) return study.Error;
105105
int outlen = (int)Clamp(study.OutlenMin, target.Length, study.OutlenMax);
106106

@@ -131,7 +131,7 @@ public IpsError ApplyStudy(Stream patch, IpsStudy study, Stream target)
131131
offset = Read24(patchReader);
132132
}
133133
}
134-
if (study.OutlenMax != 0xFFFFFFFF && targetLength <= study.OutlenMax) study.Error = IpsError.IpsNotThis; // Truncate data without this being needed is a poor idea.
134+
if (study.OutlenMax != 0xFFFFFFFF && source.Length <= study.OutlenMax) study.Error = IpsError.IpsNotThis; // Truncate data without this being needed is a poor idea.
135135
return study.Error;
136136
}
137137

0 commit comments

Comments
 (0)