summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-02 09:51:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-02 14:28:29 +0200
commitc085fc7cd335e3ea50a6bbaedf2f6e8cffadf559 (patch)
treeee0da8dcecf823268721cbedc89cd47a485a024b /vcl
parentf773e7aa8c96e070085ece95889f02590ed65f89 (diff)
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: I827ddc6692280dbad44b03cfa07f1f35375080c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121502 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/ipcd/ipcd.cxx12
1 files changed, 8 insertions, 4 deletions
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 ];