# HG changeset patch # User kostya # Date 1201940887 0 # Node ID 195356fc72308817af04b88bda9efa99cb4cb334 # Parent e0601aa8ebef7fb09d2f0515069dd4080ce2ebbe Do not modify input data diff -r e0601aa8ebef -r 195356fc7230 imc.c --- a/imc.c Sat Feb 02 08:26:49 2008 +0000 +++ b/imc.c Sat Feb 02 08:28:07 2008 +0000 @@ -636,12 +636,12 @@ int flag; int bits, summer; int counter, bitscount; - uint16_t *buf16 = (uint16_t *) buf; + uint16_t buf16[IMC_BLOCK_SIZE / 2]; for(i = 0; i < IMC_BLOCK_SIZE / 2; i++) - buf16[i] = bswap_16(buf16[i]); + buf16[i] = bswap_16(((const uint16_t*)buf)[i]); - init_get_bits(&q->gb, buf, IMC_BLOCK_SIZE * 8); + init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8); /* Check the frame header */ imc_hdr = get_bits(&q->gb, 9);