Bug 1209780. Check DrawResult return value in nsBaseDragService. r=seth

This commit is contained in:
Timothy Nikkel 2016-03-10 00:37:18 -06:00
parent 0e6b05c3b8
commit 1477693fe7

View File

@ -694,10 +694,14 @@ nsBaseDragService::DrawDragForImage(nsIImageLoadingContent* aImageLoader,
if (!ctx)
return NS_ERROR_FAILURE;
imgContainer->Draw(ctx, destSize, ImageRegion::Create(destSize),
imgIContainer::FRAME_CURRENT,
Filter::GOOD, Nothing(),
imgIContainer::FLAG_SYNC_DECODE);
DrawResult res =
imgContainer->Draw(ctx, destSize, ImageRegion::Create(destSize),
imgIContainer::FRAME_CURRENT,
Filter::GOOD, Nothing(),
imgIContainer::FLAG_SYNC_DECODE);
if (res == DrawResult::BAD_IMAGE || res == DrawResult::BAD_ARGS) {
return NS_ERROR_FAILURE;
}
*aSurface = dt->Snapshot();
} else {
*aSurface = aCanvas->GetSurfaceSnapshot();