test_codec: Align the codec buffer to pointer size, since tlsf wants that. Fixes a crash when running tremor in test_codec on 64 bit sim. (The tlsf init bailed out but tremor doesn't check the return and went on to alloc memory anyway)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28365 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2010-10-27 15:07:05 +00:00
parent 77b3529246
commit 60c640b549

View file

@ -803,6 +803,9 @@ enum plugin_status plugin_start(const void* parameter)
dspbuffer = wavbuffer + buffer_size / 2; dspbuffer = wavbuffer + buffer_size / 2;
codec_mallocbuf = rb->plugin_get_audio_buffer(&audiosize); codec_mallocbuf = rb->plugin_get_audio_buffer(&audiosize);
/* Align codec_mallocbuf to pointer size, tlsf wants that */
codec_mallocbuf = (void*)(((intptr_t)codec_mallocbuf +
sizeof(intptr_t)-1) & ~(sizeof(intptr_t)-1));
audiobuf = SKIPBYTES(codec_mallocbuf, CODEC_SIZE); audiobuf = SKIPBYTES(codec_mallocbuf, CODEC_SIZE);
audiosize -= CODEC_SIZE; audiosize -= CODEC_SIZE;