summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/salmisc.cxx
diff options
context:
space:
mode:
authorKai Ahrens <ka@openoffice.org>2002-01-17 14:35:33 +0000
committerKai Ahrens <ka@openoffice.org>2002-01-17 14:35:33 +0000
commitda4f1c9570299f5cb9e45bf0a63c3582e2fd6371 (patch)
tree955c253812b21c4b4bf100a87b8f1be4229ae23b /vcl/source/gdi/salmisc.cxx
parentffb307601ae926e7b5d747a3f7c2f2baf795e552 (diff)
#96615#: check range of colormap in PAL=>PAL conversion
Diffstat (limited to 'vcl/source/gdi/salmisc.cxx')
-rw-r--r--vcl/source/gdi/salmisc.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 96c23066abdc..d32176875d80 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salmisc.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: cp $ $Date: 2001-06-28 13:10:36 $
+ * last change: $Author: ka $ $Date: 2002-01-17 15:35:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,9 +134,9 @@ static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuff
BitmapColor* pColMapBuf = aColMap.ImplGetColorBuffer();
BitmapColor aIndex( 0 );
- for( USHORT i = 0, nCount = aColMap.GetEntryCount(); i < nCount; i++ )
+ for( USHORT i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
{
- if( rSrcBuffer.maPalette[ i ] == rDstBuffer.maPalette[ i ] )
+ if( ( i < nDstCount ) && ( rSrcBuffer.maPalette[ i ] == rDstBuffer.maPalette[ i ] ) )
aIndex.SetIndex( i );
else
aIndex.SetIndex( rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] ) );