summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-16 20:09:37 +0000
committerNoel Power <noel.power@suse.com>2013-01-17 10:04:41 +0000
commit54b885dbcf9cf0d32407cb068de8d72e9d441576 (patch)
tree6587690c66e15aca4a05c21b9be46b80d2e0f78f
parentf186fe6ea1808d3b75476efc7f490ea9ab510e4f (diff)
Resolves: fdo#59183 Copy 4 or more slides then crash
regression from 17afe4cea7e01aef1e5270cc09f438bc6fde3211 which is totally forgivable as its riddled with asserts that suggest there should be no out-of-bounds accesses and there probably shouldn't and those queries are possibly bugs. But double-checking 3-6 it is the case that non-existant pages were queried for in that version too, so return NULL on out-of-bounds like the original pre-stl conversion code did. Change-Id: Ic918419b6cb76b083de6b6911dde9d6e00258324 (cherry picked from commit 63de2b8f1493f24669c78df3bc2d48d13528bd9f) Reviewed-on: https://gerrit.libreoffice.org/1726 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
-rw-r--r--svx/source/svdraw/svdmodel.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 4e9c6e45bda5..75993f6dfac1 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1996,13 +1996,13 @@ SvxNumType SdrModel::GetPageNumType() const
const SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) const
{
DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
- return maPages[nPgNum];
+ return nPgNum < maPages.size() ? maPages[nPgNum] : NULL;
}
SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum)
{
DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
- return maPages[nPgNum];
+ return nPgNum < maPages.size() ? maPages[nPgNum] : NULL;
}
sal_uInt16 SdrModel::GetPageCount() const