summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/jack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/jack.c b/libavdevice/jack.c
index df829ad45a..917534d9ec 100644
--- a/libavdevice/jack.c
+++ b/libavdevice/jack.c
@@ -200,6 +200,10 @@ static int start_jack(AVFormatContext *context)
self->filled_pkts = av_fifo_alloc_array(FIFO_PACKETS_NUM, sizeof(AVPacket));
/* New packets FIFO with one extra packet for safety against underruns */
self->new_pkts = av_fifo_alloc_array((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;