summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/imageformats/webp/qwebphandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp
index 4d6bcbe..454d654 100644
--- a/src/plugins/imageformats/webp/qwebphandler.cpp
+++ b/src/plugins/imageformats/webp/qwebphandler.cpp
@@ -218,6 +218,10 @@ bool QWebpHandler::write(const QImage &image)
qWarning() << "source image is null.";
return false;
}
+ if (std::max(image.width(), image.height()) > WEBP_MAX_DIMENSION) {
+ qWarning() << "QWebpHandler::write() source image too large for WebP: " << image.size();
+ return false;
+ }
QImage srcImage = image;
bool alpha = srcImage.hasAlphaChannel();