Do not allow backgrounds whose width or height is more than 100000 pixels
svn path=/trunk/KDE/kdelibs/; revision=1065178
This commit is contained in:
parent
010bcc9629
commit
2ec6326d77
@ -36,6 +36,10 @@
|
|||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Any attempt to generate a frame whose width or height is larger than this
|
||||||
|
// will be rejected
|
||||||
|
static const int MAX_FRAME_SIZE = 100000;
|
||||||
|
|
||||||
FrameSvg::FrameSvg(QObject *parent)
|
FrameSvg::FrameSvg(QObject *parent)
|
||||||
: Svg(parent),
|
: Svg(parent),
|
||||||
d(new FrameSvgPrivate(this))
|
d(new FrameSvgPrivate(this))
|
||||||
@ -491,6 +495,10 @@ void FrameSvgPrivate::generateFrameBackground(FrameData *frame)
|
|||||||
kWarning() << "Invalid frame size" << size;
|
kWarning() << "Invalid frame size" << size;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (size.width() >= MAX_FRAME_SIZE || size.height() >= MAX_FRAME_SIZE) {
|
||||||
|
kWarning() << "Not generating frame background for a size whose width or height is more than" << MAX_FRAME_SIZE << size;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const int contentWidth = size.width() - frame->leftWidth - frame->rightWidth;
|
const int contentWidth = size.width() - frame->leftWidth - frame->rightWidth;
|
||||||
const int contentHeight = size.height() - frame->topHeight - frame->bottomHeight;
|
const int contentHeight = size.height() - frame->topHeight - frame->bottomHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user