From 7f24ee6be4b287276a98adeae5d07e29962003c1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 30 Oct 2012 21:20:21 +0100 Subject: [PATCH] Images: Heap use fixup --- images/sig-seg.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/images/sig-seg.c b/images/sig-seg.c index fae309ff..d3537840 100644 --- a/images/sig-seg.c +++ b/images/sig-seg.c @@ -122,7 +122,7 @@ prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_regi if (region->count < 2 || region->e < image_sig_prequant_thresholds[regions_count - 1] * blocks_count) { - HEAP_DELMIN(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP); + HEAP_DELETE_MIN(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP); continue; } @@ -218,9 +218,8 @@ prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_regi } prequant_finish_region(region); prequant_finish_region(region2); - HEAP_INCREASE(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP, 1); - heap[++heap_count] = region2; - HEAP_INSERT(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP); + HEAP_INCREASE(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP, 1, region); + HEAP_INSERT(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP, region2); } DBG("Pre-quantized to %u regions", regions_count); -- 2.39.5