[pulseaudio-discuss] [PATCH v2 02/12] core: Assert that memblockq's base is != 0

Peter Meerwald pmeerw at pmeerw.net
Tue Sep 15 15:01:40 PDT 2015


From: Peter Meerwald <p.meerwald at bct-electronic.com>

CID 1323598

pa_frame_size() may be 0, assert
---
 src/pulsecore/memblockq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c
index d314d4e..b7e16dc 100644
--- a/src/pulsecore/memblockq.c
+++ b/src/pulsecore/memblockq.c
@@ -78,7 +78,7 @@ pa_memblockq* pa_memblockq_new(
     bq->name = pa_xstrdup(name);
 
     bq->sample_spec = *sample_spec;
-    bq->base = pa_frame_size(sample_spec);
+    pa_assert_se(bq->base = pa_frame_size(sample_spec));
     bq->read_index = bq->write_index = idx;
 
     pa_log_debug("memblockq requested: maxlength=%lu, tlength=%lu, base=%lu, prebuf=%lu, minreq=%lu maxrewind=%lu",
-- 
1.9.1



More information about the pulseaudio-discuss mailing list