mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1224979. Check if we compute usable filters for the downscaler, and if not put the downscaler in error state so it's not used. r=edwin
This commit is contained in:
parent
3b1d48a397
commit
cf078d87e6
@ -106,11 +106,21 @@ Downscaler::BeginFrame(const nsIntSize& aOriginalSize,
|
||||
0, mTargetSize.width,
|
||||
mXFilter.get());
|
||||
|
||||
if (mXFilter->max_filter() <= 0 || mXFilter->num_values() != mTargetSize.width) {
|
||||
NS_WARNING("Failed to compute filters for image downscaling");
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
skia::resize::ComputeFilters(resizeMethod,
|
||||
mOriginalSize.height, mTargetSize.height,
|
||||
0, mTargetSize.height,
|
||||
mYFilter.get());
|
||||
|
||||
if (mYFilter->max_filter() <= 0 || mYFilter->num_values() != mTargetSize.height) {
|
||||
NS_WARNING("Failed to compute filters for image downscaling");
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Allocate the buffer, which contains scanlines of the original image.
|
||||
// pad by 15 to handle overreads by the simd code
|
||||
size_t bufferLen = mOriginalSize.width * sizeof(uint32_t) + 15;
|
||||
|
Loading…
Reference in New Issue
Block a user