summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/salmisc.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-03-20 17:41:46 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-03-20 17:43:45 +0900
commitbbdf832d48cb7f89ee9d6e355841a31c672aadd9 (patch)
treeb65a0ba6e8a8fb173eec850babc8b43184f00ef4 /vcl/source/gdi/salmisc.cxx
parent0fe02d03ac7539e9807bc336b23f17029b2a09fb (diff)
Avoid possible resource leaks by boost::scoped_array
Change-Id: I0da7f9621d2770f49a554fb97591d9cac0bde9be
Diffstat (limited to 'vcl/source/gdi/salmisc.cxx')
-rw-r--r--vcl/source/gdi/salmisc.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 3cbb4f4ae66c..9bb600ff0a5a 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -20,6 +20,7 @@
#include <vcl/bmpacc.hxx>
#include <vcl/salbtype.hxx>
#include <bmpfast.hxx>
+#include <boost/scoped_array.hpp>
#define IMPL_CASE_GET_FORMAT( Format ) \
case( BMP_FORMAT##Format ): \
@@ -217,7 +218,7 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
const ColorMask& rDstMask = rDstBuffer.maColorMask;
BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
- sal_uInt8* pColToPalMap = new sal_uInt8[ TC_TO_PAL_COLORS ];
+ boost::scoped_array<sal_uInt8> pColToPalMap(new sal_uInt8[ TC_TO_PAL_COLORS ]);
BitmapColor aIndex( 0 );
for( long nR = 0; nR < 16; nR++ )
@@ -246,8 +247,6 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
DOUBLE_SCANLINES();
}
-
- delete[] pColToPalMap;
}
BitmapBuffer* StretchAndConvert(