From 7b37a1a5144a3a4c8b0803b7e2da81e9e108bf66 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 20 Jan 2022 09:17:03 +0000 Subject: ofz: Use-of-uninitialized-value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6b768b80d972c5379005efecfb803463ca648b4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128644 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwpdrawobj.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx index f7bd4f511283..a46d44d1e51f 100644 --- a/lotuswordpro/source/filter/lwpdrawobj.cxx +++ b/lotuswordpro/source/filter/lwpdrawobj.cxx @@ -1372,11 +1372,15 @@ void LwpDrawBitmap::Read() // 20 == length of draw-specific fields. // 14 == length of bmp file header. m_aBmpRec.nFileSize = m_aObjHeader.nRecLen - 20 + 14; - m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] ); BmpInfoHeader2 aInfoHeader2; m_pStream->ReadUInt32( aInfoHeader2.nHeaderLen ); + if (!m_pStream->good()) + throw BadRead(); + + m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] ); + sal_uInt32 N; sal_uInt32 rgbTableSize; -- cgit