Kaydet (Commit) bd9cf89f authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#3587 ignore broken cgm images

Change-Id: I649ace9e3e5cc008ba09fcc72f9c9b79322d39ab
Reviewed-on: https://gerrit.libreoffice.org/43277Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ec1a8442
......@@ -33,12 +33,31 @@ CGMBitmap::~CGMBitmap()
{
}
namespace
{
bool isLegalBitsPerPixel(sal_uInt32 nBitsPerPixel)
{
switch (nBitsPerPixel)
{
case 1:
case 2:
case 4:
case 8:
case 24:
return true;
break;
default:
break;
}
return false;
}
}
void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
{
rDesc.mbStatus = true;
if ( ImplGetDimensions( rDesc ) && rDesc.mpBuf )
if (ImplGetDimensions(rDesc) && rDesc.mpBuf && isLegalBitsPerPixel(rDesc.mnDstBitsPerPixel))
{
rDesc.mpBitmap = new Bitmap( Size( rDesc.mnX, rDesc.mnY ), (sal_uInt16)rDesc.mnDstBitsPerPixel );
if ( ( rDesc.mpAcc = rDesc.mpBitmap->AcquireWriteAccess() ) != nullptr )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment