detect (and reject) if radius ia NaN, by using !(radius > 0) instead of (radius <= 0)

git-svn-id: http://skia.googlecode.com/svn/trunk@3007 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-01-11 14:07:27 +00:00
parent c79fd6ea3f
commit e582869023

View File

@ -42,7 +42,8 @@ private:
SkMaskFilter* SkBlurMaskFilter::Create(SkScalar radius,
SkBlurMaskFilter::BlurStyle style,
uint32_t flags) {
if (radius <= 0 || (unsigned)style >= SkBlurMaskFilter::kBlurStyleCount
// use !(radius > 0) instead of radius <= 0 to reject NaN values
if (!(radius > 0) || (unsigned)style >= SkBlurMaskFilter::kBlurStyleCount
|| flags > SkBlurMaskFilter::kAll_BlurFlag) {
return NULL;
}