[FFmpeg-cvslog] swr: fix assertion failure if dither is used without the preout buffer differing from in

Michael Niedermayer git at videolan.org
Tue Jan 8 20:42:15 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jan  8 16:55:46 2013 +0100| [9aec63af9b50af1d809d31389d67e98c2c688133] | committer: Michael Niedermayer

swr: fix assertion failure if dither is used without the preout buffer differing from in

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9aec63af9b50af1d809d31389d67e98c2c688133
---

 libswresample/swresample.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index f01927f..c4a647c 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -602,6 +602,11 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
     if(s->resample_first ? !s->rematrix : !s->resample)
         preout= midbuf;
 
+    if (preout == in && s->dither_method) {
+        av_assert1(postin == midbuf && midbuf == preout);
+        postin = midbuf = preout = &preout_tmp;
+    }
+
     if(s->int_sample_fmt == s->out_sample_fmt && s->out.planar){
         if(preout==in){
             out_count= FFMIN(out_count, in_count); //TODO check at the end if this is needed or redundant



More information about the ffmpeg-cvslog mailing list