diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-10-22 18:46:37 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-10-29 11:40:04 +0000 |
commit | 327c439f811a89d774db9a86f72951d295193e5f (patch) | |
tree | 677c7e245a96657e00f96613a38f868d2e4d8743 /libavdevice/jack_audio.c | |
parent | e78913052263af80855590659fb0f705e8f13c8a (diff) | |
download | ffmpeg-327c439f811a89d774db9a86f72951d295193e5f.tar.gz |
timefilter: Handle memory allocation failure
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavdevice/jack_audio.c')
-rw-r--r-- | libavdevice/jack_audio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c index 280f24dc48..c261514033 100644 --- a/libavdevice/jack_audio.c +++ b/libavdevice/jack_audio.c @@ -190,6 +190,10 @@ static int start_jack(AVFormatContext *context) period = (double) self->buffer_size / self->sample_rate; o = 2 * M_PI * 1.5 * period; /// bandwidth: 1.5Hz self->timefilter = ff_timefilter_new (1.0 / self->sample_rate, sqrt(2 * o), o * o); + if (!self->timefilter) { + jack_client_close(self->client); + return AVERROR(ENOMEM); + } /* Create FIFO buffers */ self->filled_pkts = av_fifo_alloc(FIFO_PACKETS_NUM * sizeof(AVPacket)); |