exit computeFilters if filter width is zero
The fuzzer associated with this bug triggered an assert when building the resize filter. I can't tell if there is a more fundemental bug here or not. Checking for a zero-sized filter fixes the fuzzer. R=fmalita@chromium.org BUG=595856 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810333002 Review URL: https://codereview.chromium.org/1810333002
This commit is contained in:
parent
d9dd581566
commit
fa4c20e728
@ -167,7 +167,10 @@ void SkResizeFilter::computeFilters(int srcSize,
|
||||
// is at (2.5, 2.5).
|
||||
float destFilterDist = (srcBegin + 0.5f - srcPixel) * clampedScale;
|
||||
int filterCount = SkScalarTruncToInt(srcEnd - srcBegin) + 1;
|
||||
SkASSERT(filterCount > 0);
|
||||
if (filterCount <= 0) {
|
||||
// true when srcSize is equal to srcPixel - srcSupport; this may be a bug
|
||||
return;
|
||||
}
|
||||
filterValuesArray.reset(filterCount);
|
||||
float filterSum = fBitmapFilter->evaluate_n(destFilterDist, clampedScale, filterCount,
|
||||
filterValuesArray.begin());
|
||||
|
Loading…
Reference in New Issue
Block a user