summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-03 00:48:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:12 +0200
commit9db97584ca5b1664f44f43f18546f78afd4db686 (patch)
treeb41f202248a52114d03d4d3362e7e1c92f073495
parent04bb8cc842125381a966e064fcee3e7fe8ee6386 (diff)
downloadffmpeg-9db97584ca5b1664f44f43f18546f78afd4db686.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>
-rw-r--r--libswresample/swresample.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index c534ccf0dc..e866dc24e9 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -352,6 +352,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