ffmpeg: fix handling or empty audio packets
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Mar 2012 00:43:40 +0000 (02:43 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Mar 2012 00:43:40 +0000 (02:43 +0200)
Fixes Ticket1131

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

index f66828f..d5e789e 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1083,7 +1083,7 @@ static int encode_audio_frame(AVFormatContext *s, OutputStream *ost,
     pkt.data = NULL;
     pkt.size = 0;
 
-    if (buf) {
+    if (buf && buf_size) {
         if (!ost->output_frame) {
             ost->output_frame = avcodec_alloc_frame();
             if (!ost->output_frame) {