lavr: do not try to copy to uninitialized output audio data.
authorAnton Khirnov <anton@khirnov.net>
Wed, 9 May 2012 04:36:29 +0000 (06:36 +0200)
committerAnton Khirnov <anton@khirnov.net>
Wed, 9 May 2012 15:38:23 +0000 (17:38 +0200)
This would happen at least when lavr is used as a fifo with no
conversion.

libavresample/utils.c

index e533760abc3b97073634d3d642f8563aeef23758..6d4509d7c1abed10096c8abd0ee7b7131a7d2597 100644 (file)
@@ -375,7 +375,8 @@ int avresample_convert(AVAudioResampleContext *avr, void **output,
         }
     }
 
-    return handle_buffered_output(avr, &output_buffer, current_buffer);
+    return handle_buffered_output(avr, output ? &output_buffer : NULL,
+                                  current_buffer);
 }
 
 int avresample_available(AVAudioResampleContext *avr)