Reset stream position after TryParseSound failures
This commit is contained in:
@@ -170,6 +170,7 @@ namespace OpenRA.FileFormats
|
||||
out int sampleRate)
|
||||
{
|
||||
channels = sampleBits = sampleRate = 0;
|
||||
var position = stream.Position;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -187,6 +188,10 @@ namespace OpenRA.FileFormats
|
||||
rawData = null;
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
stream.Position = position;
|
||||
}
|
||||
|
||||
channels = 1;
|
||||
sampleBits = 16;
|
||||
|
||||
Reference in New Issue
Block a user