Bug 1256515 - bail out in CanvasRenderingContext2D::DrawWindow if snapshotting draw target fails. r=bas.schouten a=lizzard

MozReview-Commit-ID: LxQ3v8zqXI
This commit is contained in:
Lee Salzman 2016-03-21 10:48:35 -04:00
parent 947d33c6bc
commit 96b2096dd3

View File

@ -4953,6 +4953,10 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& aWindow, double aX,
EnsureTarget();
if (drawDT) {
RefPtr<SourceSurface> snapshot = drawDT->Snapshot();
if (NS_WARN_IF(!snapshot)) {
aError.Throw(NS_ERROR_FAILURE);
return;
}
RefPtr<DataSourceSurface> data = snapshot->GetDataSurface();
DataSourceSurface::MappedSurface rawData;