diff --git a/modules/libpr0n/src/imgTools.cpp b/modules/libpr0n/src/imgTools.cpp index dd822a11d2b..67f4d33cacd 100644 --- a/modules/libpr0n/src/imgTools.cpp +++ b/modules/libpr0n/src/imgTools.cpp @@ -287,6 +287,8 @@ NS_IMETHODIMP imgTools::EncodeScaledImage(imgIContainer *aContainer, nsCOMPtr frame; rv = aContainer->GetFrameAt(0, getter_AddRefs(frame)); NS_ENSURE_SUCCESS(rv, rv); + if (!frame) + return NS_ERROR_NOT_AVAILABLE; PRInt32 w,h; frame->GetWidth(&w);