]> code.delx.au - pulseaudio/blobdiff - polyp/sink-input.c
introduce sink input and source output limits
[pulseaudio] / polyp / sink-input.c
index 9238fac0f55fcf539d01dd33030eac714752d942..95dc5577260c33e61cb14864c1bddf15c653b384 100644 (file)
@@ -42,6 +42,11 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con
     char st[256];
     assert(s && spec);
 
+    if (pa_idxset_ncontents(s->inputs) >= PA_MAX_INPUTS_PER_SINK) {
+        fprintf(stderr, __FILE__": Failed to create sink input: too many inputs per sink.\n");
+        return NULL;
+    }
+    
     if (!pa_sample_spec_equal(spec, &s->sample_spec))
         if (!(resampler = pa_resampler_new(spec, &s->sample_spec, s->core->memblock_stat)))
             return NULL;