summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-13 09:10:12 +0100
committerDavid Tardon <dtardon@redhat.com>2015-07-13 11:23:50 +0000
commit5ef9b838791ebb7c4d5695dce5e5fd12eddcab96 (patch)
tree7a03e23b9391f4b779358ad20b26cf2199119293 /vcl
parent3708b3eb99f9283032e4210946aaf8a57d3bd252 (diff)
emf: fix hang
Change-Id: I2410308ecccb8c5318a718bafadc7b40a98cb82b (cherry picked from commit 8695633023cc321a095753db98bdc69d2aeee058) Reviewed-on: https://gerrit.libreoffice.org/16977 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/fail/hang-1.emfbin0 -> 2225 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/fail/hang-1.emf b/vcl/qa/cppunit/graphicfilter/data/emf/fail/hang-1.emf
new file mode 100644
index 000000000000..634fccdc0f22
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/emf/fail/hang-1.emf
Binary files differ
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index d55349f4c6b2..62ba08b9eb49 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -663,7 +663,7 @@ bool EnhWMFReader::ReadEnhWMF()
SAL_INFO("vcl.emf", "\tGDI comment, length: " << length);
- if( pWMF->good() && length >= 4 ) {
+ if( pWMF->good() && length >= 4 && length <= pWMF->remainingSize() ) {
sal_uInt32 id;
pWMF->ReadUInt32( id );