From: Matthieu Gallien Date: Mon, 13 Feb 2023 14:19:54 +0000 (+0100) Subject: prevent a 0 size to assert when creating icon from svg X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~42^2~19 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9bbabd3baa6e7bbda9d57f750fe2f86ca86e1836;p=nextcloud-desktop.git prevent a 0 size to assert when creating icon from svg Signed-off-by: Matthieu Gallien --- diff --git a/src/gui/iconutils.cpp b/src/gui/iconutils.cpp index 2f6b6f2ad..01a1abbe5 100644 --- a/src/gui/iconutils.cpp +++ b/src/gui/iconutils.cpp @@ -155,7 +155,10 @@ QImage drawSvgWithCustomFillColor( return {}; } - const auto reqSize = requestedSize.isValid() ? requestedSize : svgRenderer.defaultSize(); + const auto reqSize = (requestedSize.isValid() && requestedSize.height() && requestedSize.height()) ? requestedSize : svgRenderer.defaultSize(); + if (!reqSize.isValid() || !reqSize.height() || !reqSize.height()) { + return {}; + } if (originalSize) { *originalSize = svgRenderer.defaultSize();