Bug 1167356 - Check return value of DataSourceSurface::Map in RasterImage::CopyFrame. r=Bas

This commit is contained in:
Andrew Comminos
2015-06-17 15:36:12 -04:00
parent 3863ad11ab
commit 4c94f6e3e9

View File

@@ -686,8 +686,11 @@ RasterImage::CopyFrame(uint32_t aWhichFrame, uint32_t aFlags)
}
DataSourceSurface::MappedSurface mapping;
DebugOnly<bool> success =
surf->Map(DataSourceSurface::MapType::WRITE, &mapping);
if (!surf->Map(DataSourceSurface::MapType::WRITE, &mapping)) {
gfxCriticalError() << "RasterImage::CopyFrame failed to map surface";
return nullptr;
}
NS_ASSERTION(success, "Failed to map surface");
RefPtr<DrawTarget> target =
Factory::CreateDrawTargetForData(BackendType::CAIRO,