From dbaf5f6fad2ec10f69cf46f9cb697b8760c2a01f Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Mon, 20 Jun 2022 14:45:07 +0200 Subject: [PATCH] svp: fix UB SalGraphics vector access Change-Id: Ic417ffbf91b04ebd6e6f18ac03b155fd01bbb316 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136226 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- vcl/headless/svpframe.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 9ab3864aa7cd..23a7e2595bda 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -423,7 +423,7 @@ void SvpSalFrame::UpdateSettings( AllSettings& rSettings ) aStdFont.SetFontSize(Size(0, 12)); aStyleSettings.SetMenuFont(aStdFont); - SvpSalGraphics* pGraphics = m_aGraphics.back(); + SvpSalGraphics* pGraphics = m_aGraphics.empty() ? nullptr : m_aGraphics.back(); bool bFreeGraphics = false; if (!pGraphics) {