diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-30 16:45:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-31 20:36:32 +0200 |
commit | 58da1a60424f4decffd6a946454eb8f7520ab8fb (patch) | |
tree | 62f281a032f7ce3d7a56c464dda5b83e2c66e824 /emfio/source | |
parent | 312161673912bc60865493635f9820d11f2c58f3 (diff) |
ofz: MemorySanitizer: use-of-uninitialized-value
test for eof condition before comparing the uninit val
Change-Id: Ie27c80f6c8103af4283181c522794eb878ccf588
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121373
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'emfio/source')
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 6ef7003c42bd..9d27787c205f 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -1673,14 +1673,14 @@ namespace emfio bRet = false; break; } - else if ( nRSize==3 && nFunction==0 ) + else if (pStm->eof() || nRSize < 3) { + pStm->SetError( SVSTREAM_FILEFORMAT_ERROR ); + bRet = false; break; } - else if ( nRSize < 3 || pStm->eof() ) + else if ( nRSize==3 && nFunction==0 ) { - pStm->SetError( SVSTREAM_FILEFORMAT_ERROR ); - bRet = false; break; } switch( nFunction ) |