mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-19 07:20:02 +02:00
handle malloc(0) and calloc(0) uniformly on all platforms
also change lossless encoder logic, which was relying on explicit NULL return from WebPSafeMalloc(0) renamed function to CheckSizeArgumentsOverflow() explicitly addresses issue #138 Change-Id: Ibbd51cc0281e60e86dfd4c5496274399e4c0f7f3
This commit is contained in:
@ -188,6 +188,10 @@ static int GenerateOptimalTree(const int* const histogram, int histogram_size,
|
||||
}
|
||||
}
|
||||
|
||||
if (tree_size_orig == 0) { // pretty optimal already!
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 3 * tree_size is enough to cover all the nodes representing a
|
||||
// population and all the inserted nodes combining two existing nodes.
|
||||
// The tree pool needs 2 * (tree_size_orig - 1) entities, and the
|
||||
|
Reference in New Issue
Block a user