summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-05-14 08:50:19 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-05-14 08:50:19 +0000
commitabff529213f3f46d921f576cdc97b3e42ef1b5b4 (patch)
tree6d0bc6c3cc55c46bd96ef6c7e1fb8e0a016aae62 /vcl/source
parent45e04f06b952b9a4c812cd550b467e45c729c76a (diff)
INTEGRATION: CWS vcl88 (1.11.226); FILE MERGED
2008/04/17 05:51:20 pl 1.11.226.2: RESYNC: (1.11-1.12); FILE MERGED 2008/04/09 15:16:43 pl 1.11.226.1: #b6686028# catch allocation exception
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/salmisc.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 88b02bc155ec..a57c4ad44f20 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salmisc.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
* This file is part of OpenOffice.org.
*
@@ -368,7 +368,17 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
pDstBuffer->mnWidth = rTwoRect.mnDestWidth;
pDstBuffer->mnHeight = rTwoRect.mnDestHeight;
pDstBuffer->mnScanlineSize = AlignedWidth4Bytes( pDstBuffer->mnBitCount * pDstBuffer->mnWidth );
- pDstBuffer->mpBits = new BYTE[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
+ try
+ {
+ pDstBuffer->mpBits = new BYTE[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
+ }
+ catch( const std::bad_alloc& )
+ {
+ // memory exception, clean up
+ pDstBuffer->mpBits = NULL;
+ delete pDstBuffer;
+ return NULL;
+ }
// do we need a destination palette or color mask?
if( ( nDstScanlineFormat == BMP_FORMAT_1BIT_MSB_PAL ) ||