Movie editor: Sanity-limit number of rows

This commit is contained in:
Ilari Liusvaara 2013-02-04 20:43:12 +02:00
parent 4a1838427e
commit 62cb6c0727

View file

@ -721,7 +721,7 @@ void wxeditor_movie::_moviepanel::on_popup_menu(wxCommandEvent& e)
std::string text = pick_text(m, "Set number of lines", "Set number of lines visible:",
(stringfmt() << lines_to_display).str());
unsigned tmp = parse_value<unsigned>(text);
if(tmp < 1)
if(tmp < 1 || tmp > 255)
throw std::runtime_error("Value out of range");
lines_to_display = tmp;
} catch(canceled_exception& e) {