diff --git a/modules/libpr0n/public/imgIContainer.idl b/modules/libpr0n/public/imgIContainer.idl index bc4305d05a1..4b41cdae804 100644 --- a/modules/libpr0n/public/imgIContainer.idl +++ b/modules/libpr0n/public/imgIContainer.idl @@ -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; diff --git a/modules/libpr0n/src/RasterImage.cpp b/modules/libpr0n/src/RasterImage.cpp index 4c6e9423fc1..7b7b3f343e3 100644 --- a/modules/libpr0n/src/RasterImage.cpp +++ b/modules/libpr0n/src/RasterImage.cpp @@ -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;