[libav-stable] jack: Check memory allocation

Vittorio Giovara git at libav.org
Mon Jun 8 14:09:24 CEST 2015


Module: libav
Branch: master
Commit: bc1eace1b3654c490cb2c226b3c80854244dbb9a

Author:    Vittorio Giovara <vittorio.giovara at gmail.com>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Wed Jun  3 14:16:48 2015 +0100

jack: Check memory allocation

CC: libav-stable at libav.org
Bug-Id: CID 1292520

---

 libavdevice/jack.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/jack.c b/libavdevice/jack.c
index 5d000a3..aa9348d 100644
--- a/libavdevice/jack.c
+++ b/libavdevice/jack.c
@@ -202,6 +202,10 @@ static int start_jack(AVFormatContext *context)
     self->filled_pkts = av_fifo_alloc(FIFO_PACKETS_NUM * sizeof(AVPacket));
     /* New packets FIFO with one extra packet for safety against underruns */
     self->new_pkts    = av_fifo_alloc((FIFO_PACKETS_NUM + 1) * sizeof(AVPacket));
+    if (!self->new_pkts) {
+        jack_client_close(self->client);
+        return AVERROR(ENOMEM);
+    }
     if ((test = supply_new_packets(self, context))) {
         jack_client_close(self->client);
         return test;



More information about the libav-stable mailing list