From 3dc9e4fbea63d81715e4bb4f2de29ea5e6da6e91 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 5 Jul 2012 23:05:34 +0000 Subject: [PATCH] Don't try to set the zoom dropdown selection if it'd be out of bounds Originally committed to SVN as r6928. --- aegisub/src/video_display.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 97aa08d16..2941c8d87 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -377,7 +377,9 @@ void VideoDisplay::OnKeyDown(wxKeyEvent &event) { void VideoDisplay::SetZoom(double value) { zoomValue = std::max(value, .125); - zoomBox->SetSelection(value / .125 - 1); + size_t selIndex = value / .125 - 1; + if (selIndex < zoomBox->GetCount()) + zoomBox->SetSelection(selIndex); zoomBox->ChangeValue(wxString::Format("%g%%", zoomValue * 100.)); UpdateSize(); }