mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 16:30:30 +02:00
PopupMultiChoice: Don't range-check the int-value if being initialized from PopupMultiChoiceDynamic (valgrind)
This commit is contained in:
1 parent
26d0128896
commit
67aa951fec
1 file changed
+6
-4
@@ -204,10 +204,12 @@ public:
|
||||
I18NCat category, ScreenManager *screenManager, UI::LayoutParams *layoutParams = nullptr)
|
||||
: AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), choices_(choices), minVal_(minVal), numChoices_(numChoices),
|
||||
category_(category), screenManager_(screenManager) {
|
||||
if (*value >= numChoices + minVal)
|
||||
*value = numChoices + minVal - 1;
|
||||
if (*value < minVal)
|
||||
*value = minVal;
|
||||
if (choices) {
|
||||
if (*value >= numChoices + minVal)
|
||||
*value = numChoices + minVal - 1;
|
||||
if (*value < minVal)
|
||||
*value = minVal;
|
||||
}
|
||||
OnClick.Handle(this, &PopupMultiChoice::HandleClick);
|
||||
UpdateText();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user