From 22914ca238f39e1a51170ca698119ce73aeda41c Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 6 Oct 2010 15:18:52 -0700 Subject: [PATCH] Bug 543864 patch 2: Make VectorImage::GetWidth & GetHeight return 0 in case of errors. r=roc a=roc --- modules/libpr0n/src/VectorImage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/libpr0n/src/VectorImage.cpp b/modules/libpr0n/src/VectorImage.cpp index 02d5fcedf90e..7be60e72e296 100644 --- a/modules/libpr0n/src/VectorImage.cpp +++ b/modules/libpr0n/src/VectorImage.cpp @@ -310,11 +310,13 @@ NS_IMETHODIMP VectorImage::GetWidth(PRInt32* aWidth) { if (mError || !mIsFullyLoaded) { + *aWidth = 0; return NS_ERROR_FAILURE; } if (!mSVGDocumentWrapper->GetWidthOrHeight(SVGDocumentWrapper::eWidth, *aWidth)) { + *aWidth = 0; return NS_ERROR_FAILURE; } @@ -327,11 +329,13 @@ NS_IMETHODIMP VectorImage::GetHeight(PRInt32* aHeight) { if (mError || !mIsFullyLoaded) { + *aHeight = 0; return NS_ERROR_FAILURE; } if (!mSVGDocumentWrapper->GetWidthOrHeight(SVGDocumentWrapper::eHeight, *aHeight)) { + *aHeight = 0; return NS_ERROR_FAILURE; }