зеркало из https://github.com/mozilla/pjs.git
Bug 253782 - limit image dimensions to X11 protocol limits.
r=pavlov, sr=blizzard
This commit is contained in:
Родитель
9a72bd64fe
Коммит
698bdb287b
|
@ -161,6 +161,11 @@ nsresult nsImageGTK::Init(PRInt32 aWidth, PRInt32 aHeight,
|
|||
// Assumed: Init only gets called once by gfxIImageFrame
|
||||
g_return_val_if_fail ((aWidth != 0) || (aHeight != 0), NS_ERROR_FAILURE);
|
||||
|
||||
// X Protocol limits us to image dimensions less than 32767
|
||||
// unless we want to go through lots of pain and suffering.
|
||||
if (aWidth > SHRT_MAX || aHeight > SHRT_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (24 == aDepth) {
|
||||
mNumBytesPixel = 3;
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче