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:
James Zern 2019-03-29 17:04:31 -07:00
parent af0bac643a
commit aa65f89a8f

View File

@ -929,9 +929,8 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo,
}
mappings = (int*) WebPSafeMalloc(*num_used, sizeof(*mappings));
if (mappings == NULL || !HistoQueueInit(&histo_queue, kHistoQueueSize)) {
goto End;
}
if (mappings == NULL) return 0;
if (!HistoQueueInit(&histo_queue, kHistoQueueSize)) goto End;
// Fill the initial mapping.
for (j = 0, iter = 0; iter < image_histo->size; ++iter) {
if (histograms[iter] == NULL) continue;