memblockq: Do not allow non-frame indices in the memblock queue

Since we don't allow lengths that are not frame aligned,
it does not make sense to allow indices that are not frame aligned
either.
Also, allowing such a thing to be added causes the daemon to crash
later instead (see https://bugs.freedesktop.org/show_bug.cgi?id=77595 ).

Also drop _se from assert (there is no side effect).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2014-10-16 11:41:17 +02:00
parent 4971dc9ed6
commit 6434853b04

View file

@ -287,7 +287,8 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *uchunk) {
pa_assert(uchunk->length > 0);
pa_assert(uchunk->index + uchunk->length <= pa_memblock_get_length(uchunk->memblock));
pa_assert_se(uchunk->length % bq->base == 0);
pa_assert(uchunk->length % bq->base == 0);
pa_assert(uchunk->index % bq->base == 0);
if (!can_push(bq, uchunk->length))
return -1;