From 31a95393e69dbf1b200e323d25182c8b381ddce8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 6 May 2023 19:28:58 +0100 Subject: cid#1529287 Explicit null dereferenced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit after commit c55d5586304f23f9d8acbaffefba68a3a11c6175 Date: Sat Apr 1 16:10:33 2023 +0100 BinaryDataContainer: hand out shared_ptr's to SvStreams. and commit 0f2581204a70038ed7ca78089a9bd96d158e02c0 Date: Mon Apr 3 09:34:54 2023 +0100 BinaryDataContainer swap out implementation. it is possible that a eLinkType of GfxLinkType::NativeGif and a nStreamLength of 0 could lead to BinaryDataContainer::getAsStream being called on a default ctored BinaryDataContainer which would mean an mpImpl of null and a null dereference here Change-Id: Id964e3ce97e5527c5357576131fe03440f1ea00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151453 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/filter/graphicfilter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index e51b027be701..2cbe95e50194 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -912,7 +912,7 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size { bool bAnimated = false; Size aLogicSize; - if (eLinkType == GfxLinkType::NativeGif) + if (eLinkType == GfxLinkType::NativeGif && !aGraphicContent.isEmpty()) { std::shared_ptr pMemoryStream = aGraphicContent.getAsStream(); bAnimated = IsGIFAnimated(*pMemoryStream, aLogicSize); -- cgit