Fix potential buffer overflow when playing 10^18 beats :)

This commit is contained in:
chousemp3 2025-09-12 19:04:25 +02:00 committed by Robin Gareus
parent 2ba290e904
commit 9dafed2d76
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -3298,7 +3298,7 @@ MidiView::update_resizing (NoteBase* primary, bool at_front, double delta_x, boo
*/
len = std::max (Temporal::Beats (0, 128), len);
char buf[16];
char buf[24];
/* represent as float frac to help out the user */
snprintf (buf, sizeof (buf), "%.3f beats", len.get_beats() + (len.get_ticks()/(double)Temporal::ticks_per_beat));
show_verbose_cursor (buf, 0, 0);