aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2008-12-17 02:30:26 +0000
committerMåns Rullgård <mans@mansr.com>2008-12-17 02:30:26 +0000
commit6c414bb6d49b5c797a0cf25b2859281b855b9352 (patch)
tree11afb1383bb8043dbb33dcb51177ea3ba9836d55
parentcb56b440868269db68306a4fd35fa85953fb7ba4 (diff)
downloadffmpeg-6c414bb6d49b5c797a0cf25b2859281b855b9352.tar.gz
AC3: fix strict aliasing violation in parser
Originally committed as revision 16181 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/ac3_parser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index aedcbcd472..ccd687ae13 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -158,11 +158,14 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int *need_next_header, int *new_frame_start)
{
int err;
- uint64_t tmp = be2me_64(state);
+ union {
+ uint64_t u64;
+ uint8_t u8[8];
+ } tmp = { be2me_64(state) };
AC3HeaderInfo hdr;
GetBitContext gbc;
- init_get_bits(&gbc, ((uint8_t *)&tmp)+8-AC3_HEADER_SIZE, 54);
+ init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
err = ff_ac3_parse_header(&gbc, &hdr);
if(err < 0)