<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - libpulsecommon.so unaligned memory access issue"
href="https://bugs.freedesktop.org/show_bug.cgi?id=65474#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - libpulsecommon.so unaligned memory access issue"
href="https://bugs.freedesktop.org/show_bug.cgi?id=65474">bug 65474</a>
from <span class="vcard"><a class="email" href="mailto:changyp6@gmail.com" title="Yupeng Chang <changyp6@gmail.com>"> <span class="fn">Yupeng Chang</span></a>
</span></b>
<pre>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!</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>