Bug 1897745 - Check for null surface in ScaleDataSourceSurface. r=aosmond
Every use of ScaleDataSourceSurface checks for a null result and just spits out a warning. So here it seems reasonable to check the input is valid, and if not, just spit out that null result. This should give us more consistent behavior between debug and opt builds. Differential Revision: https://phabricator.services.mozilla.com/D212501
This commit is contained in:
@@ -288,7 +288,9 @@ static already_AddRefed<DataSourceSurface> CropAndCopyDataSourceSurface(
|
||||
*/
|
||||
static already_AddRefed<DataSourceSurface> ScaleDataSourceSurface(
|
||||
DataSourceSurface* aSurface, const ImageBitmapOptions& aOptions) {
|
||||
MOZ_ASSERT(aSurface);
|
||||
if (NS_WARN_IF(!aSurface)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const SurfaceFormat format = aSurface->GetFormat();
|
||||
const int bytesPerPixel = BytesPerPixel(format);
|
||||
|
||||
Reference in New Issue
Block a user