OSDN Git Service

jack: Check memory allocation
authorFederico Tomassetti <f.tomassetti@gmail.com>
Sun, 19 Apr 2015 11:28:58 +0000 (12:28 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Sun, 19 Apr 2015 22:50:48 +0000 (23:50 +0100)
Bug-Id: CID 1265785
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavdevice/jack.c

index fc5caa8..5d000a3 100644 (file)
@@ -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 */