From a8fc79910f32a171b2bcd376cc24321b4e70354c Mon Sep 17 00:00:00 2001 From: feos Date: Fri, 31 Jul 2015 00:30:40 +0300 Subject: [PATCH] tastudio: clamp newCell for dragged branches. this fixes another OOB crash. --- BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index b3f1981f0b2..2d5a661fe91 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -346,6 +346,9 @@ private void BranchView_CellDropped(object sender, InputRoll.CellEventArgs e) int originalIndex = Branches.IndexOf(branch); int newIndex = e.NewCell.RowIndex.Value; + if (newIndex >= Branches.Count) + newIndex = Branches.Count - 1; + Branches.Remove(branch); Branches.Insert(newIndex, branch); }