diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-20 11:23:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-20 11:28:34 +0100 |
commit | aa1c590b29d30b11c2f4830e6bc08e8f936f557f (patch) | |
tree | b51e5dc61b279af0171d84efe3903ca23e1a18b7 | |
parent | 1fa0ee127ea2f41cb8913d5158fadcaa19c0f305 (diff) | |
download | ffmpeg-aa1c590b29d30b11c2f4830e6bc08e8f936f557f.tar.gz |
swr: fix assert failure
Bug found by: Oana Stratulat
GCI-id: 7211207
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libswresample/swresample.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 0575f7dead..f97a2c1b19 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -202,7 +202,12 @@ int swr_init(struct SwrContext *s){ if(!s->out.ch_count) s->out.ch_count= av_get_channel_layout_nb_channels(s->out_ch_layout); -av_assert0(s-> in.ch_count); + if(!s-> in.ch_count){ + av_assert0(!s->in_ch_layout); + av_log(s, AV_LOG_ERROR, "Input channel count and layout are unset\n"); + return -1; + } + av_assert0(s->used_ch_count); av_assert0(s->out.ch_count); s->resample_first= RSC*s->out.ch_count/s->in.ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0; |