summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/svg/qsvghandler.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 8e30428..ba6a919 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -2684,8 +2684,16 @@ static QSvgNode *createImageNode(QSvgNode *parent,
qreal nheight = parseLength(height, type, handler);
nheight = convertToPixels(nheight, false, type);
-
filename = filename.trimmed();
+ if (filename.isEmpty()) {
+ qWarning() << "QSvgHandler: Image filename is empty";
+ return 0;
+ }
+ if (nwidth <= 0 || nheight <= 0) {
+ qWarning() << "QSvgHandler: Width or height for" << filename << "image was not greater than 0";
+ return 0;
+ }
+
QImage image;
if (filename.startsWith(QLatin1String("data"))) {
int idx = filename.lastIndexOf(QLatin1String("base64,"));