diff options
author | Måns Rullgård <mans@mansr.com> | 2008-12-17 02:30:22 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2008-12-17 02:30:22 +0000 |
commit | cb56b440868269db68306a4fd35fa85953fb7ba4 (patch) | |
tree | 8b14e79c6398d1b585c99c9d9b43879183f1260b | |
parent | a2fc0f6a6ddf884ace3c96a0d4f09f0932e6db32 (diff) | |
download | ffmpeg-cb56b440868269db68306a4fd35fa85953fb7ba4.tar.gz |
AAC: fix strict aliasing violation in parser
Originally committed as revision 16180 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/aac_parser.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index 1d75e1e859..3ff14163da 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -32,10 +32,13 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, { 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; |