[FFmpeg-cvslog] swr: check that there is enough information to do rematrixing when needed.
Michael Niedermayer
git at videolan.org
Fri Mar 23 12:25:39 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Mar 23 12:10:08 2012 +0100| [ae03b2141e451f0a3330566f2f2c8e3b9186c2ad] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae03b2141e451f0a3330566f2f2c8e3b9186c2ad
---
libswresample/swresample.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index dd09fc9..44a2917 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list