summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpvt_generateap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r--core/fpdfdoc/cpvt_generateap.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 7b4ad2ff4f..3c2b47c275 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -370,7 +370,8 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc,
FX_BOOL bSelected = FALSE;
if (pSels) {
for (size_t s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
- if (i == pSels->GetIntegerAt(s)) {
+ int value = pSels->GetIntegerAt(s);
+ if (value >= 0 && i == static_cast<size_t>(value)) {
bSelected = TRUE;
break;
}