From b94b70315772660e17c6dc58b3ac8c4c123a672f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 6 Aug 2016 21:19:32 +0100 Subject: [PATCH 1/2] Add a check for bogus Frames / Length combinations. --- OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index c77b77f6db..77d546e133 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -254,6 +254,11 @@ namespace OpenRA.Mods.Common.Graphics "{0}: Sequence {1}.{2}: Length must be <= stride" .F(info.Nodes[0].Location, sequence, animation)); + if (Frames != null && Length > Frames.Length) + throw new InvalidOperationException( + "{0}: Sequence {1}.{2}: Length must be <= Frames.Length" + .F(info.Nodes[0].Location, sequence, animation)); + if (Start < 0 || Start + Facings * Stride > sprites.Length) throw new InvalidOperationException( "{5}: Sequence {0}.{1} uses frames [{2}..{3}], but only 0..{4} actually exist" From 2b59cf08e857586ce685c82f50f5a5fa22c5bb4c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 6 Aug 2016 21:19:41 +0100 Subject: [PATCH 2/2] Fix grenadier death sequences. --- mods/d2k/sequences/infantry.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/d2k/sequences/infantry.yaml b/mods/d2k/sequences/infantry.yaml index 77a87abcfa..9507bbbd2b 100644 --- a/mods/d2k/sequences/infantry.yaml +++ b/mods/d2k/sequences/infantry.yaml @@ -444,16 +444,16 @@ grenadier: Tick: 120 die1: DATA.R8 Frames: 2694, 2701, 2708, 2715, 2722, 2729, 2736, 2743 - Length: 19 + Length: 8 die2: DATA.R8 Frames: 2695, 2702, 2709, 2716, 2723, 2730, 2737, 2744 - Length: 19 + Length: 8 die3: DATA.R8 Frames: 2696, 2703, 2710, 2717, 2724, 2731, 2738, 2745 - Length: 19 + Length: 8 die4: DATA.R8 Frames: 2697, 2704, 2711, 2718, 2725, 2732, 2738, 2746 - Length: 19 + Length: 8 die-crushed: DATA.R8 Frames: 2698, 2705, 2712, 2719, 2726, 2733, 2740, 2747 Tick: 800