Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2012-05-05 04:01:56 +0400
committerGregory Maxwell <greg@xiph.org>2012-05-05 04:01:56 +0400
commita403d5f7b5163abcb934aa18e4fc29799f3c7875 (patch)
tree71362f27f2414f99de6e5e089288602bb7edb33f /src
parentb7034ec262515c659b3b5660b1edcb31bf679274 (diff)
Increase alignment of the internal state structures to sizeof(void *) from 4 bytes.
OpusCustomMode begins with a pointer and was getting misaligned on 64 bit arches.
Diffstat (limited to 'src')
-rw-r--r--src/opus_private.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/opus_private.h b/src/opus_private.h
index 2c5c7390..6534a5ed 100644
--- a/src/opus_private.h
+++ b/src/opus_private.h
@@ -74,11 +74,10 @@ int encode_size(int size, unsigned char *data);
int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 len,
opus_val16 *pcm, int frame_size, int decode_fec, int self_delimited, int *packet_offset);
-/* Make sure everything's aligned to 4 bytes (this may need to be increased
- on really weird architectures) */
+/* Make sure everything's aligned to sizeof(void *) bytes */
static inline int align(int i)
{
- return (i+3)&-4;
+ return (i+sizeof(void *)-1)&-sizeof(void *);
}
opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen, int self_delimited);