HistogramCombineStochastic: fix free of uninit value

previously if the mappings allocation failed histo_queue->queue would be
uninitialized; split the conditionals

Change-Id: I1b50b987e734393893dc8a83a3f314522ccd0c83
(cherry picked from commit aa65f89a8f)
This commit is contained in:
James Zern 2019-03-29 17:04:31 -07:00
parent fa58371c6a
commit 4fdc903597

View File

@ -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;