From 386e2755aab73ae7075f78d92786cb5c5419597a Mon Sep 17 00:00:00 2001 From: Federico Tomassetti Date: Sun, 19 Apr 2015 12:28:58 +0100 Subject: [PATCH] jack: Check memory allocation Bug-Id: CID 1265785 Signed-off-by: Vittorio Giovara --- libavdevice/jack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavdevice/jack.c b/libavdevice/jack.c index fc5caa8830..5d000a3cd0 100644 --- a/libavdevice/jack.c +++ b/libavdevice/jack.c @@ -165,6 +165,8 @@ static int start_jack(AVFormatContext *context) self->sample_rate = jack_get_sample_rate(self->client); self->ports = av_malloc(self->nports * sizeof(*self->ports)); + if (!self->ports) + return AVERROR(ENOMEM); self->buffer_size = jack_get_buffer_size(self->client); /* Register JACK ports */