Bug 1167356 - Check return value of DataSourceSurface::Map in RasterImage::CopyFrame. r=Bas
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user