diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-17 15:29:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-17 16:39:22 +0100 |
commit | 9d22ab17b75e57d0e98ba1bf387f3274b0065643 (patch) | |
tree | 7a76754956a0bda02f31530faf1ff01ddb47097b /vcl | |
parent | 7a54951fbb43c50f8b65876eb0e9672fdcf73e25 (diff) |
coverity#735993 Explicit null dereferenced
Change-Id: Ib8b1af5a783a2bae285c24e5153cce4713a2e2dd
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/salmisc.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx index 9bb600ff0a5a..3fc4c3cb5c15 100644 --- a/vcl/source/gdi/salmisc.cxx +++ b/vcl/source/gdi/salmisc.cxx @@ -342,7 +342,12 @@ BitmapBuffer* StretchAndConvert( ( nDstScanlineFormat == BMP_FORMAT_4BIT_LSN_PAL ) || ( nDstScanlineFormat == BMP_FORMAT_8BIT_PAL ) ) { - DBG_ASSERT( pDstPal, "destination buffer requires palette" ); + assert(pDstPal && "destination buffer requires palette"); + if (!pDstPal) + { + delete pDstBuffer; + return NULL; + } pDstBuffer->maPalette = *pDstPal; } else if( ( nDstScanlineFormat == BMP_FORMAT_8BIT_TC_MASK ) || @@ -351,7 +356,12 @@ BitmapBuffer* StretchAndConvert( ( nDstScanlineFormat == BMP_FORMAT_24BIT_TC_MASK ) || ( nDstScanlineFormat == BMP_FORMAT_32BIT_TC_MASK ) ) { - DBG_ASSERT( pDstMask, "destination buffer requires color mask" ); + assert(pDstMask && "destination buffer requires color mask"); + if (!pDstMask) + { + delete pDstBuffer; + return NULL; + } pDstBuffer->maColorMask = *pDstMask; } |