summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2017-10-02 02:16:57 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2017-10-01 21:11:16 +0200
commitd64dd40552bdcfe4fd2ab0d10f0c72796e579487 (patch)
tree6d11df5923a9d1544c84069e6720f91153d769c0 /drawinglayer
parentf4944b4e9b8ce8aeb521613cc67334f256b8cc31 (diff)
drawinglayer: should be warning, not info SAL_LOG messages
We should warn if EMF+ record < 12 bytes. Similarly, if the record size is less than 12 bytes, that's evidence of a corrupted EMF+ record, same with if the length or datasize is too long. Thus we should warn at this point. Also - if an if statement is not part of another if/else block then best to have a newline separating them so they don't look like they are part of that block. Change-Id: I914c754fe7437d6d4b6f2e4aec2d28475eaf5d70 Reviewed-on: https://gerrit.libreoffice.org/43004 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 419cd778f7be..2962193b9e5f 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -741,9 +741,7 @@ namespace emfplushelper
sal_uInt64 length = rMS.GetSize();
if (length < 12)
- {
- SAL_INFO("cppcanvas.emf", "length is less than required header size");
- }
+ SAL_WARN("cppcanvas.emf", "length is less than required header size");
// 12 is minimal valid EMF+ record size; remaining bytes are padding
while (length >= 12)
@@ -757,17 +755,12 @@ namespace emfplushelper
next = rMS.Tell() + (size - 12);
if (size < 12)
- {
- SAL_INFO("cppcanvas.emf", "Size field is less than 12 bytes");
- }
+ SAL_WARN("cppcanvas.emf", "Size field is less than 12 bytes");
else if (size > length)
- {
- SAL_INFO("cppcanvas.emf", "Size field is greater than bytes left");
- }
+ SAL_WARN("cppcanvas.emf", "Size field is greater than bytes left");
+
if (dataSize > (size - 12))
- {
- SAL_INFO("cppcanvas.emf", "DataSize field is greater than Size-12");
- }
+ SAL_WARN("cppcanvas.emf", "DataSize field is greater than Size-12");
SAL_INFO("cppcanvas.emf", "EMF+ record size: " << size << " type: " << emfTypeToName(type) << " flags: " << flags << " data size: " << dataSize);