mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
Fix corner case in CostManagerInit.
Change-Id: I91795d05eb78816d6d9a8cadc64d3814650d2aee
This commit is contained in:
parent
ab7937a5c7
commit
c7eb06f737
@ -791,7 +791,8 @@ static int CostManagerInit(CostManager* const manager,
|
|||||||
// difference is found, a new interval is created and bounded.
|
// difference is found, a new interval is created and bounded.
|
||||||
for (i = 0; i < cost_cache_size; ++i) {
|
for (i = 0; i < cost_cache_size; ++i) {
|
||||||
const double cost_val = manager->cost_cache_[i];
|
const double cost_val = manager->cost_cache_[i];
|
||||||
if (fabs(cost_val - cost_prev) > min_cost_diff && cur + 1 < end) {
|
if (i == 0 ||
|
||||||
|
(fabs(cost_val - cost_prev) > min_cost_diff && cur + 1 < end)) {
|
||||||
if (i > 1) {
|
if (i > 1) {
|
||||||
const int is_writable =
|
const int is_writable =
|
||||||
IsCostCacheIntervalWritable(cur->start_, cur->end_);
|
IsCostCacheIntervalWritable(cur->start_, cur->end_);
|
||||||
|
Loading…
Reference in New Issue
Block a user