diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-02 11:17:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-02 14:49:05 +0100 |
commit | 850b8dc7a2116647da30b45a60d8d8ef12214545 (patch) | |
tree | b39b2d50c404c77f3e7e6eb3d699f0de9f964c76 | |
parent | ba8469f6ef8525ea15a5fd749b2389b6853cf1e5 (diff) |
coverity#1242483 Unintentional integer overflow
Change-Id: Ie258b4b6d4d99c7b2b0d61550a840539b216d09f
-rw-r--r-- | vcl/unx/generic/gdi/salbmp.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index c997bc656da8..e68078e7c919 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -343,9 +343,8 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = std::min( (sal_uLong)rColMap.GetUsed() - , (sal_uLong)(1 << nDrawableDepth) - ); + const sal_uInt16 nCols = std::min((sal_uLong)rColMap.GetUsed(), + sal_uLong(1) << nDrawableDepth); rPal.SetEntryCount( nCols ); pDstPal = &rPal; |