summaryrefslogtreecommitdiff
path: root/goodies/source/graphic
diff options
context:
space:
mode:
authorKai Ahrens <ka@openoffice.org>2001-11-20 12:41:20 +0000
committerKai Ahrens <ka@openoffice.org>2001-11-20 12:41:20 +0000
commitcef644e62311e538fb043f84a02768c139857206 (patch)
tree974ca6cdaa0a6625f8a24919056e22b1895a080b /goodies/source/graphic
parent68ab968cfa97e964470ff752b847978c40d1bf11 (diff)
#94949#: don't create cache object if extent is too large
Diffstat (limited to 'goodies/source/graphic')
-rw-r--r--goodies/source/graphic/grfcache.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/goodies/source/graphic/grfcache.cxx b/goodies/source/graphic/grfcache.cxx
index 45e32e5725f9..f50070f8a72a 100644
--- a/goodies/source/graphic/grfcache.cxx
+++ b/goodies/source/graphic/grfcache.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: grfcache.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: ka $ $Date: 2001-09-17 14:16:34 $
+ * last change: $Author: ka $ $Date: 2001-11-20 13:41:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,7 @@
// -----------
#define RELEASE_TIMEOUT 10000
+#define MAX_BMP_EXTENT 4096
// -----------
// - statics -
@@ -508,7 +509,12 @@ ULONG GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point&
const Size aOutSizePix( pOut->LogicToPixel( rSz ) );
const long nBitCount = pOut->GetBitCount();
- if( nBitCount )
+ if( ( aOutSizePix.Width() > MAX_BMP_EXTENT ) ||
+ ( aOutSizePix.Height() > MAX_BMP_EXTENT ) )
+ {
+ nNeededSize = ULONG_MAX;
+ }
+ else if( nBitCount )
{
nNeededSize = aOutSizePix.Width() * aOutSizePix.Height() * nBitCount / 8;