[pulseaudio-discuss] [PATCH 1/3] memblockq: Do not allow non-frame indices in the memblock queue
David Henningsson
david.henningsson at canonical.com
Thu Oct 16 02:41:17 PDT 2014
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 ).
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
src/pulsecore/memblockq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c
index 571107d..09e8ee3 100644
--- a/src/pulsecore/memblockq.c
+++ b/src/pulsecore/memblockq.c
@@ -288,6 +288,7 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *uchunk) {
pa_assert(uchunk->index + uchunk->length <= pa_memblock_get_length(uchunk->memblock));
pa_assert_se(uchunk->length % bq->base == 0);
+ pa_assert_se(uchunk->index % bq->base == 0);
if (!can_push(bq, uchunk->length))
return -1;
--
1.9.1
More information about the pulseaudio-discuss
mailing list