If you create a VSTGUI::COptionMenu (any way other than copy constructing an existing one) and call getMax() or getRange() before adding any entries, these return 18446744073709551616. This is because getMax() bases its result on calling size() on an empty std::vector minus one, which wraps to 64-bit unsigned integer max i.e. 18446744073709551615 and then casts that to 32-bit float which cannot represent that value and instead rounds to 18446744073709551616.
proposed fix attached
coptionmenu.h.patch
If you create a
VSTGUI::COptionMenu
(any way other than copy constructing an existing one) and callgetMax()
orgetRange()
before adding any entries, these return 18446744073709551616. This is becausegetMax()
bases its result on callingsize()
on an emptystd::vector
minus one, which wraps to 64-bit unsigned integer max i.e. 18446744073709551615 and then casts that to 32-bit float which cannot represent that value and instead rounds to 18446744073709551616. proposed fix attached coptionmenu.h.patch