diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-03 16:16:48 +0300 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-08 15:03:27 +0300 |
commit | bc1eace1b3654c490cb2c226b3c80854244dbb9a (patch) | |
tree | b7fce687ea37d1f43f9ddc8213fa8c178893bcb1 | |
parent | f7e932473314e6ca4c851d49cbde8570b6e66383 (diff) |
jack: Check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1292520
-rw-r--r-- | libavdevice/jack.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/jack.c b/libavdevice/jack.c index 5d000a3cd0..aa9348df09 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; |