From d5288dd29611f2e5c4140724255cea8e7bb2b25b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 4 Jan 2022 21:27:40 +0000 Subject: ofz#42785 Timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stream::Seek (like istream::seekg) clears any eofbit Change-Id: I90253e69a52c4099aa2971294a215dff37e8a246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127975 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sd/source/filter/ppt/pptatom.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sd') diff --git a/sd/source/filter/ppt/pptatom.cxx b/sd/source/filter/ppt/pptatom.cxx index 90e61e738ffb..20d52eb8c63f 100644 --- a/sd/source/filter/ppt/pptatom.cxx +++ b/sd/source/filter/ppt/pptatom.cxx @@ -39,13 +39,11 @@ Atom::Atom( const DffRecordHeader& rRecordHeader, SvStream& rStream ) // retrieve file size (to allow sanity checks) sal_uInt64 const nStreamSize = mrStream.TellEnd(); - while( (mrStream.GetError() == ERRCODE_NONE ) + while( mrStream.good() && ( mrStream.Tell() < nStreamSize ) && ( mrStream.Tell() < maRecordHeader.GetRecEndFilePos() ) ) { - ReadDffRecordHeader( mrStream, aChildHeader ); - - if( mrStream.GetError() == ERRCODE_NONE ) + if (ReadDffRecordHeader(mrStream, aChildHeader)) { Atom* pAtom = new Atom( aChildHeader, mrStream ); -- cgit