libavfilter/af_atempo: Fix uninitialized memory access
authorPavel Koshevoy <pkoshevoy@gmail.com>
Sun, 21 Apr 2013 03:33:55 +0000 (21:33 -0600)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 21 Apr 2013 08:45:57 +0000 (10:45 +0200)
valgrind reported uninitialized memory access which was caused by
incorrect number of samples being passed to push_samples(..)

Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/af_atempo.c

index 3e2bc06..4d1c68a 100644 (file)
@@ -1082,7 +1082,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *src_buffer)
         yae_apply(atempo, &src, src_end, &atempo->dst, atempo->dst_end);
 
         if (atempo->dst == atempo->dst_end) {
-            ret = push_samples(atempo, outlink, n_out);
+            int n_samples = ((atempo->dst - atempo->dst_buffer->data[0]) /
+                             atempo->stride);
+            ret = push_samples(atempo, outlink, n_samples);
             if (ret < 0)
                 goto end;
         }