mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 695962. imglib: Remove a bunch of null checks after new. r=bholley
This commit is contained in:
parent
f24dfcb1b4
commit
34d35f37f6
@ -339,7 +339,6 @@ RasterImage::ExtractFrame(PRUint32 aWhichFrame,
|
||||
|
||||
// Make a new container. This should switch to another class with bug 505959.
|
||||
nsRefPtr<RasterImage> img(new RasterImage());
|
||||
NS_ENSURE_TRUE(img, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
// We don't actually have a mimetype in this case. The empty string tells the
|
||||
// init routine not to try to instantiate a decoder. This should be fixed in
|
||||
@ -849,7 +848,6 @@ RasterImage::InternalAddFrame(PRUint32 framenum,
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsAutoPtr<imgFrame> frame(new imgFrame());
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -1650,10 +1648,6 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
||||
// Create the Compositing Frame
|
||||
if (!mAnim->compositingFrame) {
|
||||
mAnim->compositingFrame = new imgFrame();
|
||||
if (!mAnim->compositingFrame) {
|
||||
NS_WARNING("Failed to init compositingFrame!\n");
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsresult rv = mAnim->compositingFrame->Init(0, 0, mSize.width, mSize.height,
|
||||
gfxASurface::ImageFormatARGB32);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -1765,10 +1759,6 @@ RasterImage::DoComposite(nsIntRect* aDirtyRect,
|
||||
// overwrite.
|
||||
if (!mAnim->compositingPrevFrame) {
|
||||
mAnim->compositingPrevFrame = new imgFrame();
|
||||
if (!mAnim->compositingPrevFrame) {
|
||||
NS_WARNING("Failed to init compositingPrevFrame!\n");
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsresult rv = mAnim->compositingPrevFrame->Init(0, 0, mSize.width, mSize.height,
|
||||
gfxASurface::ImageFormatARGB32);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -2353,8 +2343,6 @@ RasterImage::RequestDecode()
|
||||
// a little slower).
|
||||
if (mInDecoder) {
|
||||
nsRefPtr<imgDecodeRequestor> requestor = new imgDecodeRequestor(this);
|
||||
if (!requestor)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
return NS_DispatchToCurrentThread(requestor);
|
||||
}
|
||||
|
||||
|
@ -474,8 +474,6 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter,
|
||||
nsresult imgFrame::Extract(const nsIntRect& aRegion, imgFrame** aResult)
|
||||
{
|
||||
nsAutoPtr<imgFrame> subImage(new imgFrame());
|
||||
if (!subImage)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// The scaling problems described in bug 468496 are especially
|
||||
// likely to be visible for the sub-image, as at present the only
|
||||
|
@ -735,7 +735,6 @@ nsresult imgLoader::CreateNewProxyForRequest(imgRequest *aRequest, nsILoadGroup
|
||||
proxyRequest = static_cast<imgRequestProxy *>(aProxyRequest);
|
||||
} else {
|
||||
proxyRequest = new imgRequestProxy();
|
||||
if (!proxyRequest) return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
NS_ADDREF(proxyRequest);
|
||||
|
||||
@ -893,8 +892,6 @@ nsresult imgLoader::InitCache()
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
gCacheObserver = new imgCacheObserver();
|
||||
if (!gCacheObserver)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(gCacheObserver);
|
||||
|
||||
os->AddObserver(gCacheObserver, "memory-pressure", false);
|
||||
@ -902,8 +899,6 @@ nsresult imgLoader::InitCache()
|
||||
os->AddObserver(gCacheObserver, "chrome-flush-caches", false);
|
||||
|
||||
gCacheTracker = new imgCacheExpirationTracker();
|
||||
if (!gCacheTracker)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
if (!sCache.Init())
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -197,9 +197,6 @@ NS_IMETHODIMP imgTools::EncodeScaledImage(imgIContainer *aContainer,
|
||||
// Create a temporary image surface
|
||||
dest = new gfxImageSurface(gfxIntSize(aScaledWidth, aScaledHeight),
|
||||
gfxASurface::ImageFormatARGB32);
|
||||
if (!dest)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
gfxContext ctx(dest);
|
||||
|
||||
// Set scaling
|
||||
|
Loading…
Reference in New Issue
Block a user