summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-26 11:58:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-26 15:03:08 +0200
commit3f750c1e7f8b4dac1dac0333a3f8270e1d7fea00 (patch)
tree91e567c1f8cb6495a36829c64204678182c027a4 /drawinglayer
parentb6b1ded0a0539e7be1b5338de378a3276a6ff445 (diff)
forcepoint#47 bail when we detect the emf is broken
Change-Id: I065635393763af774b45cbba6bd85c4334383b93 Reviewed-on: https://gerrit.libreoffice.org/56456 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 78b76ecfe647..c529c255beb1 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -830,12 +830,21 @@ namespace emfplushelper
next = rMS.Tell() + (size - 12);
if (size < 12)
+ {
SAL_WARN("drawinglayer", "Size field is less than 12 bytes");
+ break;
+ }
else if (size > length)
+ {
SAL_WARN("drawinglayer", "Size field is greater than bytes left");
+ break;
+ }
if (dataSize > (size - 12))
+ {
SAL_WARN("drawinglayer", "DataSize field is greater than Size-12");
+ break;
+ }
SAL_INFO("drawinglayer", "EMF+ record size: " << size << " type: " << emfTypeToName(type) << " flags: " << flags << " data size: " << dataSize);