From: Martin Mares Date: Tue, 30 Oct 2012 20:20:21 +0000 (+0100) Subject: Images: Heap use fixup X-Git-Tag: v5.99~101 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7f24ee6be4b287276a98adeae5d07e29962003c1;p=libucw.git Images: Heap use fixup --- 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);