mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07: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
51a4b1650c
commit
2679542a37
@ -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