Fix a crash when encountering 0 byte .vqa placeholders.

This commit is contained in:
Matthias Mailänder
2022-04-24 13:11:40 +02:00
committed by abcdefg30
parent 9e34299085
commit 91fbd618ce
5 changed files with 33 additions and 10 deletions

View File

@@ -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;

View File

@@ -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;