зеркало из https://github.com/mozilla/pjs.git
Bug 543864 patch 1: Make RasterImage::GetWidth & GetHeight return 0 in case of errors. r=roc a=roc
This commit is contained in:
Родитель
cf6b20e2ba
Коммит
e79c62ef4c
|
@ -81,12 +81,14 @@ native gfxGraphicsFilter(gfxPattern::GraphicsFilter);
|
|||
interface imgIContainer : nsISupports
|
||||
{
|
||||
/**
|
||||
* The width of the container rectangle.
|
||||
* The width of the container rectangle. In the case of any error,
|
||||
* zero is returned, and an exception will be thrown.
|
||||
*/
|
||||
readonly attribute PRInt32 width;
|
||||
|
||||
/**
|
||||
* The height of the container rectangle.
|
||||
* The height of the container rectangle. In the case of any error,
|
||||
* zero is returned, and an exception will be thrown.
|
||||
*/
|
||||
readonly attribute PRInt32 height;
|
||||
|
||||
|
|
|
@ -389,8 +389,10 @@ RasterImage::GetWidth(PRInt32 *aWidth)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aWidth);
|
||||
|
||||
if (mError)
|
||||
if (mError) {
|
||||
*aWidth = 0;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
*aWidth = mSize.width;
|
||||
return NS_OK;
|
||||
|
@ -403,8 +405,10 @@ RasterImage::GetHeight(PRInt32 *aHeight)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aHeight);
|
||||
|
||||
if (mError)
|
||||
if (mError) {
|
||||
*aHeight = 0;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
*aHeight = mSize.height;
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче