From c085fc7cd335e3ea50a6bbaedf2f6e8cffadf559 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 2 Sep 2021 09:51:11 +0100 Subject: ofz: MemorySanitizer: use-of-uninitialized-value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I827ddc6692280dbad44b03cfa07f1f35375080c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121502 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/filter/ipcd/ipcd.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/filter/ipcd/ipcd.cxx b/vcl/source/filter/ipcd/ipcd.cxx index b3377c8934e3..dbe7eb12d5db 100644 --- a/vcl/source/filter/ipcd/ipcd.cxx +++ b/vcl/source/filter/ipcd/ipcd.cxx @@ -226,10 +226,14 @@ void PCDReader::ReadImage() m_rPCD.Seek( nImagePos ); // next pair of rows := first pair of rows: - m_rPCD.ReadBytes( pL0N, nWidth ); - m_rPCD.ReadBytes( pL1N, nWidth ); - m_rPCD.ReadBytes( pCbN, nW2 ); - m_rPCD.ReadBytes( pCrN, nW2 ); + if (m_rPCD.ReadBytes(pL0N, nWidth) != nWidth || + m_rPCD.ReadBytes(pL1N, nWidth) != nWidth || + m_rPCD.ReadBytes(pCbN, nW2) != nW2 || + m_rPCD.ReadBytes(pCrN, nW2) != nW2) + { + bStatus = false; + return; + } pCbN[ nW2 ] = pCbN[ nW2 - 1 ]; pCrN[ nW2 ] = pCrN[ nW2 - 1 ]; -- cgit