diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-10-16 11:41:17 +0200 |
---|---|---|
committer | David Henningsson <david.henningsson@canonical.com> | 2014-10-24 14:59:31 +0200 |
commit | 6434853b0449c6adf6a8b16905188928b495a006 (patch) | |
tree | 412460e8b880346d9bbf3313f6a2f50bd6c716d9 | |
parent | 4971dc9ed695256cfb179c5ef4d7bf43d3826ba2 (diff) |
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>
-rw-r--r-- | src/pulsecore/memblockq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c index 571107dac..16a62da5a 100644 --- a/src/pulsecore/memblockq.c +++ b/src/pulsecore/memblockq.c @@ -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; |