mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
HistogramCombineStochastic: fix free of uninit value
previously if the mappings allocation failed histo_queue->queue would be uninitialized; split the conditionals Change-Id: I1b50b987e734393893dc8a83a3f314522ccd0c83
This commit is contained in:
parent
af0bac643a
commit
aa65f89a8f
@ -929,9 +929,8 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mappings = (int*) WebPSafeMalloc(*num_used, sizeof(*mappings));
|
mappings = (int*) WebPSafeMalloc(*num_used, sizeof(*mappings));
|
||||||
if (mappings == NULL || !HistoQueueInit(&histo_queue, kHistoQueueSize)) {
|
if (mappings == NULL) return 0;
|
||||||
goto End;
|
if (!HistoQueueInit(&histo_queue, kHistoQueueSize)) goto End;
|
||||||
}
|
|
||||||
// Fill the initial mapping.
|
// Fill the initial mapping.
|
||||||
for (j = 0, iter = 0; iter < image_histo->size; ++iter) {
|
for (j = 0, iter = 0; iter < image_histo->size; ++iter) {
|
||||||
if (histograms[iter] == NULL) continue;
|
if (histograms[iter] == NULL) continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user