diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-06 11:42:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-06 16:35:44 +0000 |
commit | 21e6fd2b2dfdb806db320f699e434e6f2351a7b6 (patch) | |
tree | f5b3f9f0dbe5840e4968c7afeda7c201556abd37 /sd | |
parent | 08e08a4562fdb4c03c78eca937f840b0f7c018e6 (diff) |
coverity#1190350 Dereference after null check
Change-Id: Ia863c587b998270f68e6a6439891ce18a07ed626
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/sddetect.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx index 1d957b36c0bc..614773c7d7f7 100644 --- a/sd/source/ui/unoidl/sddetect.cxx +++ b/sd/source/ui/unoidl/sddetect.cxx @@ -352,17 +352,19 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes pStm = aMedium.GetInStream(); if (!pStm) pFilter = NULL; - - pStm->Seek(STREAM_SEEK_TO_END); - const sal_Size nSize = pStm->Tell(); - pStm->Seek(STREAM_SEEK_TO_BEGIN); - - // Do not attempt to create an SotStorage on a - // 0-length stream as that would create the compound - // document header on the stream and effectively write to - // disk! - if (!nSize) - pFilter = NULL; + else + { + pStm->Seek(STREAM_SEEK_TO_END); + const sal_Size nSize = pStm->Tell(); + pStm->Seek(STREAM_SEEK_TO_BEGIN); + + // Do not attempt to create an SotStorage on a + // 0-length stream as that would create the compound + // document header on the stream and effectively write to + // disk! + if (!nSize) + pFilter = NULL; + } } if (pFilter && pStm) |