fix overflow in qsort compare proc
git-svn-id: http://skia.googlecode.com/svn/trunk@335 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
0da41dbf5b
commit
593847a0e0
@ -383,7 +383,11 @@ extern "C" {
|
||||
valuea = edgea->fX;
|
||||
valueb = edgeb->fX;
|
||||
}
|
||||
return valuea - valueb;
|
||||
|
||||
// this overflows if valuea >>> valueb or vice-versa
|
||||
// return valuea - valueb;
|
||||
// do perform the slower but safe compares
|
||||
return (valuea < valueb) ? -1 : (valuea > valueb);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user