From d608a304ecd3be4481632dbad091279abcf07a02 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 22 Jan 2017 21:46:47 +0000 Subject: return early on not good Change-Id: I4aca6cb1c3dae652595b93ff7507db713a668d5f --- vcl/source/filter/sgfbram.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl') diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx index 20afdf0b094f..ed2a96175991 100644 --- a/vcl/source/filter/sgfbram.cxx +++ b/vcl/source/filter/sgfbram.cxx @@ -323,6 +323,8 @@ bool SgfBMapFilter(SvStream& rInp, SvStream& rOut) nFileStart=rInp.Tell(); ReadSgfHeader( rInp, aHead ); + if (!rIStream.good()) + return false; if (aHead.ChkMagic() && (aHead.Typ==SgfBitImag0 || aHead.Typ==SgfBitImag1 || aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo)) { -- cgit