diff --git a/SourceGen/WpfGui/GotoBox.xaml.cs b/SourceGen/WpfGui/GotoBox.xaml.cs index 3e95c53..5144c99 100644 --- a/SourceGen/WpfGui/GotoBox.xaml.cs +++ b/SourceGen/WpfGui/GotoBox.xaml.cs @@ -136,7 +136,10 @@ namespace SourceGen.WpfGui { if (input[0] == '+') { // this can only be an offset; convert as hexadecimal number try { - TargetOffset = Convert.ToInt32(input.Substring(1), 16); + int offset = Convert.ToInt32(input.Substring(1), 16); + if (offset >= 0 && offset < mProject.FileDataLength) { + TargetOffset = offset; + } } catch (Exception) { } return;