[pulseaudio-tickets] [Bug 65474] libpulsecommon.so unaligned memory access issue

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Dec 3 02:59:56 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=65474

--- Comment #2 from Yupeng Chang <changyp6 at gmail.com> ---
Hi Arun,
The simplest way to fix this is to add another structure

struct hasmap_table {
    struct pa_hashmap hashmap;
    struct hashmap_entry* entry[NBUCKETS];
};

change
#define BY_HASH(h) ((struct hashmap_entry**) ((uint8_t*) (h) +
PA_ALIGN(sizeof(pa_hashmap))))

to
#define BY_HASH(h) (((struct hashmap_table*)h)->entry)

Then, change
h = pa_xmalloc0(PA_ALIGN(sizeof(pa_hashmap)) + NBUCKETS*sizeof(struct
hashmap_entry*));

to

h = pa_xmalloc0(sizeof(struct hashmap_table));

I found there are lots of files in pulseaudio have cast-align issue.

I did this modification and compiled, no warnings anymore. But I have test if
this modification is OK.

If you think this modification is OK, please help test..
Thanks you!

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20131203/054f23eb/attachment.html>


More information about the pulseaudio-bugs mailing list