Fix and integer overflow issue in SDK's QuickSort
authorBo Xu <bo_xu@foxitsoftware.com>
Tue, 24 Jun 2014 18:37:49 +0000 (11:37 -0700)
committerBo Xu <bo_xu@foxitsoftware.com>
Tue, 24 Jun 2014 18:37:49 +0000 (11:37 -0700)
BUG=382639
R=mdempsky@chromium.org

Review URL: https://codereview.chromium.org/354673002

fpdfsdk/include/fsdk_mgr.h

index bb25b35..e6a9219 100644 (file)
@@ -564,7 +564,7 @@ private:
                        return;
                }
                
-               FX_UINT m = (nStartPos + nStopPos) / 2;
+               FX_UINT m = nStartPos + (nStopPos - nStartPos) / 2;
                FX_UINT i = nStartPos;
                
                TYPE Value = this->GetAt(m);