diff options
author | Ramiro Polla <ramiro@lisha.ufsc.br> | 2009-06-15 14:38:30 +0000 |
---|---|---|
committer | Jeff Downs <heydowns@borg.com> | 2009-06-15 14:38:30 +0000 |
commit | 7cc8d616aab68ba5534e5a74214786ad08aac5ce (patch) | |
tree | 494ea5e97880d6b2fb849310d9a838bb41253a3f /libavcodec/mlp.c | |
parent | d9982edfed1c9285ab0f1104df6c045323433a3b (diff) | |
download | ffmpeg-7cc8d616aab68ba5534e5a74214786ad08aac5ce.tar.gz |
Fix unaligned accesses by doing bytewise access until aligned, then
continuing in 32-bit quantities.
Fixes crash observed on sparc during FATE mlp test.
Patch by Ramiro.
Originally committed as revision 19200 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mlp.c')
-rw-r--r-- | libavcodec/mlp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mlp.c b/libavcodec/mlp.c index c522617e0b..a290e465e5 100644 --- a/libavcodec/mlp.c +++ b/libavcodec/mlp.c @@ -96,6 +96,8 @@ uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size) uint32_t scratch = 0; const uint8_t *buf_end = buf + buf_size; + for (; ((intptr_t) buf & 3) && buf < buf_end; buf++) + scratch ^= *buf; for (; buf < buf_end - 3; buf += 4) scratch ^= *((const uint32_t*)buf); |