mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-02-22 15:53:15 -05:00
Limits the max DDS size to 300000x300000 pixels
This commit is contained in:
@ -229,7 +229,7 @@ Below are the maximum sizes for each plugin ('n/a' means no limit, i.e. the
|
|||||||
limit depends on the format encoding).
|
limit depends on the format encoding).
|
||||||
- ANI: n/a
|
- ANI: n/a
|
||||||
- AVIF: 32,768 x 32,768 pixels, in any case no larger than 256 megapixels
|
- AVIF: 32,768 x 32,768 pixels, in any case no larger than 256 megapixels
|
||||||
- DDS: n/a
|
- DDS: 300,000 x 300,000 pixels
|
||||||
- EXR: 300,000 x 300,000 pixels
|
- EXR: 300,000 x 300,000 pixels
|
||||||
- EPS: same size as Qt's JPG plugin
|
- EPS: same size as Qt's JPG plugin
|
||||||
- HDR: 300,000 x 300,000 pixels
|
- HDR: 300,000 x 300,000 pixels
|
||||||
|
|||||||
@ -24,6 +24,16 @@
|
|||||||
// #define DDS_DISABLE_STRIDE_ALIGNMENT
|
// #define DDS_DISABLE_STRIDE_ALIGNMENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *** DDS_MAX_IMAGE_WIDTH and DDS_MAX_IMAGE_HEIGHT ***
|
||||||
|
* The maximum size in pixel allowed by the plugin.
|
||||||
|
*/
|
||||||
|
#ifndef DDS_MAX_IMAGE_WIDTH
|
||||||
|
#define DDS_MAX_IMAGE_WIDTH KIF_LARGE_IMAGE_PIXEL_LIMIT
|
||||||
|
#endif
|
||||||
|
#ifndef DDS_MAX_IMAGE_HEIGHT
|
||||||
|
#define DDS_MAX_IMAGE_HEIGHT DDS_MAX_IMAGE_WIDTH
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
Q_LOGGING_CATEGORY(LOG_DDSPLUGIN, "kf.imageformats.plugins.dds", QtDebugMsg)
|
Q_LOGGING_CATEGORY(LOG_DDSPLUGIN, "kf.imageformats.plugins.dds", QtDebugMsg)
|
||||||
#else
|
#else
|
||||||
@ -2543,8 +2553,8 @@ bool QDDSHandler::verifyHeader(const DDSHeader &dds) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dds.width > INT_MAX || dds.height > INT_MAX) {
|
if (dds.width > DDS_MAX_IMAGE_WIDTH || dds.height > DDS_MAX_IMAGE_HEIGHT) {
|
||||||
qCWarning(LOG_DDSPLUGIN) << "Can't read image with w/h bigger than INT_MAX";
|
qCWarning(LOG_DDSPLUGIN) << "Can't read image with size bigger than" << DDS_MAX_IMAGE_WIDTH << "x" << DDS_MAX_IMAGE_HEIGHT << "pixels";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user