mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-21 23:10:13 +00:00
swr: check that there is enough information to do rematrixing when needed.
Fixes assertion failure. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2e909b3c77
commit
ae03b2141e
@ -226,6 +226,11 @@ int swr_init(struct SwrContext *s){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((!s->out_ch_layout || !s->in_ch_layout) && s->used_ch_count != s->out.ch_count && !s->rematrix_custom) {
|
||||
av_log(s, AV_LOG_ERROR, "Rematrix is needed but there is not enough information to do it\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;
|
||||
|
Loading…
Reference in New Issue
Block a user