changeset 8360:850b735daef8 libavcodec

AAC: fix strict aliasing violation in parser
author mru
date Wed, 17 Dec 2008 02:30:22 +0000
parents 9281a8a9387a
children c34d5e164b22
files aac_parser.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/aac_parser.c	Wed Dec 17 00:54:54 2008 +0000
+++ b/aac_parser.c	Wed Dec 17 02:30:22 2008 +0000
@@ -32,10 +32,13 @@
 {
     GetBitContext bits;
     int size, rdb, ch, sr;
-    uint8_t tmp[8];
+    union {
+        uint64_t u64;
+        uint8_t  u8[8];
+    } tmp;
 
-    AV_WB64(tmp, state);
-    init_get_bits(&bits, tmp+8-AAC_HEADER_SIZE, AAC_HEADER_SIZE * 8);
+    tmp.u64 = be2me_64(state);
+    init_get_bits(&bits, tmp.u8+8-AAC_HEADER_SIZE, AAC_HEADER_SIZE * 8);
 
     if(get_bits(&bits, 12) != 0xfff)
         return 0;