diff options
author | Vas Crabb <vas@vastheman.com> | 2021-05-23 05:10:33 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2021-05-23 05:10:33 +1000 |
commit | 4c0d120873725e81d9ca8d13b17e10eef41641da (patch) | |
tree | 53624fae2e98090c8136a44cfbe65101d80e3067 | |
parent | 3ccdbfc3b57ae76cdd338fc5ba9f75ca909606ad (diff) |
ui/selmenu.cpp: Don't make assumptions about what's off the end of a string view (GitHub #7967).
-rw-r--r-- | src/frontend/mame/ui/selmenu.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index 236a33225bc..b470291ab52 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -2820,7 +2820,7 @@ void menu_select_launch::infos_render(float origx1, float origy1, float origx2, { int itemline = r + m_topline_datsview; std::string_view const tempbuf(std::string_view(m_info_buffer).substr(xstart[itemline], xend[itemline] - xstart[itemline])); - if (tempbuf[0] == '#') + if (!tempbuf.empty() && (tempbuf[0] == '#')) continue; if (r == 0 && m_topline_datsview != 0) // up arrow |