Fixes a memleak when using the -frames option with audio.
---
 avconv.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/avconv.c b/avconv.c
index affb877..9a3c75d 100644
--- a/avconv.c
+++ b/avconv.c
@@ -887,8 +887,10 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, 
OutputStream *ost)
      * reordering, see do_video_out()
      */
     if (!(avctx->codec_type == AVMEDIA_TYPE_VIDEO && avctx->codec)) {
-        if (ost->frame_number >= ost->max_frames)
+        if (ost->frame_number >= ost->max_frames) {
+            av_free_packet(pkt);
             return;
+        }
         ost->frame_number++;
     }
 
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to