diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2023-11-08 09:08:06 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-12-12 17:33:12 +0000 |
commit | 1b0f4df30263ad5cf95950f77761a9d813836927 (patch) | |
tree | 6e9724abbd44592ef5253dfeaab4ab6a757cd08a /src/plugins/imageformats/jp2 | |
parent | cc3b9a462a264ca9a9819f2e2c091393e3a22b49 (diff) |
Fix allocation limit checking bug in jp2 handler
Checking should be disabled if the limit is set to 0.
Fixes: QTBUG-118797
Pick-to: 6.7 6.6
Change-Id: Ie5e01fb3d3b44eae957dbb66237eb7e9d13dc8b6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/plugins/imageformats/jp2')
-rw-r--r-- | src/plugins/imageformats/jp2/qjp2handler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/imageformats/jp2/qjp2handler.cpp b/src/plugins/imageformats/jp2/qjp2handler.cpp index fe08995..09a1c11 100644 --- a/src/plugins/imageformats/jp2/qjp2handler.cpp +++ b/src/plugins/imageformats/jp2/qjp2handler.cpp @@ -306,7 +306,8 @@ Jpeg2000JasperReader::Jpeg2000JasperReader(QIODevice *iod, SubFormat format) #else jas_conf_clear(); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - jas_conf_set_max_mem_usage(QImageReader::allocationLimit() * 1024 * 1024); + if (QImageReader::allocationLimit() > 0) + jas_conf_set_max_mem_usage(qsizetype(QImageReader::allocationLimit()) * 1024 * 1024); #else // 128MB seems to be enough. jas_conf_set_max_mem_usage(128 * 1024 * 1024); |