diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-04-07 20:23:26 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-04-08 23:16:25 +0200 |
commit | e7bb3a52067c426eedffddf86e7d5f0903562da2 (patch) | |
tree | a655ee4aed8ceedc61dde01f68619f7202344045 /chart2 | |
parent | c16f7ca43bb338f23895733ee499505ee6a6e72e (diff) |
cid#1596254 Null pointer dereferences in GetSotStorageStream
Re-arrange the calling convention to make it obvious that
a valid stream is the same as a good (true) result.
Change-Id: I974b023a8e7231e70ab649628fdbe43c33001e5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165874
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController_Tools.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 539516de7466..5774ff1350d4 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -266,8 +266,7 @@ void ChartController::executeDispatch_Paste() { if ( aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) ) { - std::unique_ptr<SvStream> xStm; - if ( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xStm ) ) + if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING) ) { xStm->Seek( 0 ); Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ) ); @@ -284,8 +283,7 @@ void ChartController::executeDispatch_Paste() else if ( aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) ) { // graphic exchange format (graphic manager bitmap format?) - std::unique_ptr<SvStream> xStm; - if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm )) + if (std::unique_ptr<SvStream> xStm = aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB )) { TypeSerializer aSerializer(*xStm); aSerializer.readGraphic(aGraphic); |