changeset 6308:195356fc7230 libavcodec

Do not modify input data
author kostya
date Sat, 02 Feb 2008 08:28:07 +0000
parents e0601aa8ebef
children af4b8e1f9b6c
files imc.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);