mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-25 13:18:22 +01:00
GetBackwardReferences: fail on alloc error
previously failures in the call to VP8LBackwardReferencesTraceBackwards() would be ignored which, though it wouldn't result in a crash, would produce non-deterministic output Change-Id: Id9890a60883c3270ec75e968506d46eea32b76d4 (cherry picked from commite3cfafaf71
) (cherry picked from commit20ef03ee35
) (cherry picked from commit89e226a3c7
)
This commit is contained in:
parent
b2c2d237a4
commit
127a4d7c99
@ -910,13 +910,14 @@ static VP8LBackwardRefs* GetBackwardReferences(
|
|||||||
quality >= 25) {
|
quality >= 25) {
|
||||||
const VP8LHashChain* const hash_chain_tmp =
|
const VP8LHashChain* const hash_chain_tmp =
|
||||||
(lz77_type_best == kLZ77Standard) ? hash_chain : &hash_chain_box;
|
(lz77_type_best == kLZ77Standard) ? hash_chain : &hash_chain_box;
|
||||||
if (VP8LBackwardReferencesTraceBackwards(width, height, argb, *cache_bits,
|
double bit_cost_trace;
|
||||||
hash_chain_tmp, best, worst)) {
|
if (!VP8LBackwardReferencesTraceBackwards(width, height, argb, *cache_bits,
|
||||||
double bit_cost_trace;
|
hash_chain_tmp, best, worst)) {
|
||||||
VP8LHistogramCreate(histo, worst, *cache_bits);
|
goto Error;
|
||||||
bit_cost_trace = VP8LHistogramEstimateBits(histo);
|
|
||||||
if (bit_cost_trace < bit_cost_best) best = worst;
|
|
||||||
}
|
}
|
||||||
|
VP8LHistogramCreate(histo, worst, *cache_bits);
|
||||||
|
bit_cost_trace = VP8LHistogramEstimateBits(histo);
|
||||||
|
if (bit_cost_trace < bit_cost_best) best = worst;
|
||||||
}
|
}
|
||||||
|
|
||||||
BackwardReferences2DLocality(width, best);
|
BackwardReferences2DLocality(width, best);
|
||||||
|
Loading…
Reference in New Issue
Block a user