mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
remove cases of equal comparison for qsort()
Returning 0 (equal) can lead to undefined behaviour. And, in our cases we'll never have equal keys (added asserts for that) Change-Id: Ifaf202df321d3f877ad2a03de42e0d6cdd1b2388
This commit is contained in:
@ -37,7 +37,8 @@ extern "C" {
|
||||
static int CompareColors(const void* p1, const void* p2) {
|
||||
const uint32_t a = *(const uint32_t*)p1;
|
||||
const uint32_t b = *(const uint32_t*)p2;
|
||||
return (a < b) ? -1 : (a > b) ? 1 : 0;
|
||||
assert(a != b);
|
||||
return (a < b) ? -1 : 1;
|
||||
}
|
||||
|
||||
// If number of colors in the image is less than or equal to MAX_PALETTE_SIZE,
|
||||
|
Reference in New Issue
Block a user