Fix a crash when encountering 0 byte .vqa placeholders.
This commit is contained in:
committed by
abcdefg30
parent
9e34299085
commit
91fbd618ce
@@ -21,6 +21,9 @@ namespace OpenRA.Mods.Cnc.VideoLoaders
|
||||
{
|
||||
video = null;
|
||||
|
||||
if (s.Length == 0)
|
||||
return false;
|
||||
|
||||
if (!IsWestwoodVqa(s))
|
||||
return false;
|
||||
|
||||
@@ -28,7 +31,7 @@ namespace OpenRA.Mods.Cnc.VideoLoaders
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsWestwoodVqa(Stream s)
|
||||
static bool IsWestwoodVqa(Stream s)
|
||||
{
|
||||
var start = s.Position;
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@ namespace OpenRA.Mods.Cnc.VideoLoaders
|
||||
{
|
||||
video = null;
|
||||
|
||||
if (s.Length == 0)
|
||||
return false;
|
||||
|
||||
if (!IsWsa(s))
|
||||
return false;
|
||||
|
||||
@@ -29,7 +32,7 @@ namespace OpenRA.Mods.Cnc.VideoLoaders
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsWsa(Stream s)
|
||||
static bool IsWsa(Stream s)
|
||||
{
|
||||
var start = s.Position;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user