summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-12 21:07:21 +0100
committerDavid Tardon <dtardon@redhat.com>2015-07-13 13:19:28 +0000
commitb7bcf8ccc15f7d80a3966a340b987dfa9fd41bd0 (patch)
treedd63252b1dbd7b7be425514603acdf8de4718f1c /vcl
parent86247d7236cd38a8ae29c66c13e06356fb170b34 (diff)
emf: test for negative numbers
Change-Id: I9d9b6f3e9592ca7b85cee5422e43d4ca46b8bb36 (cherry picked from commit 4661b2dd34bd7c56b6d783d49f265e9ecde19caa) Reviewed-on: https://gerrit.libreoffice.org/16970 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/emf/pass/crash-1.emfbin0 -> 7068 bytes
-rw-r--r--vcl/source/filter/wmf/enhwmf.cxx2
2 files changed, 1 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/emf/pass/crash-1.emf b/vcl/qa/cppunit/graphicfilter/data/emf/pass/crash-1.emf
new file mode 100644
index 000000000000..bbc0285db6d2
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/emf/pass/crash-1.emf
Binary files differ
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 62ba08b9eb49..bd486103619b 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -1425,7 +1425,7 @@ bool EnhWMFReader::ReadEnhWMF()
DBG_ASSERT( ( nOptions & ( ETO_PDY | ETO_GLYPH_INDEX ) ) == 0, "SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF" );
Point aPos( ptlReferenceX, ptlReferenceY );
- if ( nLen && nLen < static_cast<sal_Int32>( SAL_MAX_UINT32 / sizeof(sal_Int32) ) )
+ if ( nLen > 0 && nLen < static_cast<sal_Int32>( SAL_MAX_UINT32 / sizeof(sal_Int32) ) )
{
if ( offDx && (( nCurPos + offDx + nLen * 4 ) <= nNextPos ) )
{