jack: Check memory allocation

Bug-Id: CID 1265785
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
Federico Tomassetti 2015-04-19 12:28:58 +01:00 committed by Vittorio Giovara
parent 617814b4a7
commit 386e2755aa

View File

@ -165,6 +165,8 @@ static int start_jack(AVFormatContext *context)
self->sample_rate = jack_get_sample_rate(self->client); self->sample_rate = jack_get_sample_rate(self->client);
self->ports = av_malloc(self->nports * sizeof(*self->ports)); self->ports = av_malloc(self->nports * sizeof(*self->ports));
if (!self->ports)
return AVERROR(ENOMEM);
self->buffer_size = jack_get_buffer_size(self->client); self->buffer_size = jack_get_buffer_size(self->client);
/* Register JACK ports */ /* Register JACK ports */