cid#1607242 Overflowed return value

Change-Id: I9efb14bf8395168043e8b3dbe94e7eb84577a175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174894
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-10-14 13:10:33 +02:00
parent 9c7cf67e9c
commit 3aa81e4735

View file

@ -1572,7 +1572,11 @@ sal_Int16 VCLXListBox::getSelectedItemPos()
{
SolarMutexGuard aGuard;
VclPtr< ListBox > pBox = GetAs< ListBox >();
return pBox ? pBox->GetSelectedEntryPos() : 0;
if (!pBox)
return 0;
sal_Int32 nPos = pBox->GetSelectedEntryPos();
assert(nPos <= SAL_MAX_INT16);
return nPos;
}
css::uno::Sequence<sal_Int16> VCLXListBox::getSelectedItemsPos()