summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-12 16:29:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-12 18:26:05 +0200
commit77c46e3e259def8569c1bdde072466dcb2781fb4 (patch)
tree5426440208b2e8623252564424585c49273c912c /filter
parentResolves tdf#137187 - More dictionaries via extensions dialog (diff)
downloadcore-77c46e3e259def8569c1bdde072466dcb2781fb4.tar.gz
core-77c46e3e259def8569c1bdde072466dcb2781fb4.zip
ofz: TimeOut short-circuit with a zero mnScanSize
Change-Id: I3ac7848170e8075fe192731495361cb2c5777e75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104215 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/bitmap.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx
index 3075cf733e48..26b837f3be04 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -81,6 +81,8 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
try {
+ if (rDesc.mnScanSize) {
+
vcl::bitmap::RawBitmap aBitmap( Size( rDesc.mnX, rDesc.mnY ), 24 );
// the picture may either be read from left to right or right to left, from top to bottom ...
@@ -212,6 +214,12 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
}
break;
}
+
+ if ( rDesc.mbStatus )
+ rDesc.mxBitmap = vcl::bitmap::CreateFromData(std::move(aBitmap));
+
+ }
+
double nX = rDesc.mnR.X - rDesc.mnQ.X;
double nY = rDesc.mnR.Y - rDesc.mnQ.Y;
@@ -253,9 +261,6 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
rDesc.mnOrigin.Y += rDesc.mnQ.Y - rDesc.mnR.Y;
}
- if ( rDesc.mbStatus )
- rDesc.mxBitmap = vcl::bitmap::CreateFromData(std::move(aBitmap));
-
} catch (const std::bad_alloc&) {
rDesc.mbStatus = false;
}