diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-03 00:48:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-28 02:33:56 +0200 |
commit | fd989ff9ca4dfe3fb9b5b41737740d58b6c5a873 (patch) | |
tree | 5fd3042b45182125dd02ec7f490ac2cddf205284 /libswresample | |
parent | 6b2163caabadf3bd5618ce78720035946b5493f3 (diff) | |
download | ffmpeg-fd989ff9ca4dfe3fb9b5b41737740d58b6c5a873.tar.gz |
swresample: Check the return value of resampler->init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 02915602d9313aa4b108342a3081244b9d2422bf)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r-- | libswresample/swresample.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index a29dc6215e..c5ac1b35b6 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -255,6 +255,10 @@ av_cold int swr_init(struct SwrContext *s){ if (s->out_sample_rate!=s->in_sample_rate || (s->flags & SWR_FLAG_RESAMPLE)){ s->resample = s->resampler->init(s->resample, s->out_sample_rate, s->in_sample_rate, s->filter_size, s->phase_shift, s->linear_interp, s->cutoff, s->int_sample_fmt, s->filter_type, s->kaiser_beta, s->precision, s->cheby); + if (!s->resample) { + av_log(s, AV_LOG_ERROR, "Failed to initilaize resampler\n"); + return AVERROR(ENOMEM); + } }else s->resampler->free(&s->resample); if( s->int_sample_fmt != AV_SAMPLE_FMT_S16P |