[FFmpeg-cvslog] swr-test: fix division by 0

Michael Niedermayer git at videolan.org
Tue Oct 16 19:46:13 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Oct 16 19:40:57 2012 +0200| [9de5b11d58eda59fae6faf1b4238612fa5b4fc1f] | committer: Michael Niedermayer

swr-test: fix division by 0

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

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

 libswresample/swresample-test.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswresample/swresample-test.c b/libswresample/swresample-test.c
index 7260a76..a0dfe28 100644
--- a/libswresample/swresample-test.c
+++ b/libswresample/swresample-test.c
@@ -372,7 +372,7 @@ int main(int argc, char **argv){
             sse= sum_aa + sum_bb - 2*sum_ab;
             if(sse < 0 && sse > -0.00001) sse=0; //fix rounding error
 
-            fprintf(stderr, "[e:%f c:%f max:%f] len:%5d\n", sqrt(sse/out_count), sum_ab/(sqrt(sum_aa*sum_bb)), maxdiff, out_count);
+            fprintf(stderr, "[e:%f c:%f max:%f] len:%5d\n", out_count ? sqrt(sse/out_count) : 0, sum_ab/(sqrt(sum_aa*sum_bb)), maxdiff, out_count);
         }
 
         flush_i++;



More information about the ffmpeg-cvslog mailing list