ffprobe: fix leak in show_packets()
authorStefano Sabatini <stefasab@gmail.com>
Wed, 11 Jan 2012 23:30:24 +0000 (00:30 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Thu, 12 Jan 2012 09:39:24 +0000 (10:39 +0100)
Call av_free_packets() at each demuxing loop iteration, not only when
decoding.

X-ColaCount: +10l

ffprobe.c

index 44f2a15..485950d 100644 (file)
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1349,8 +1349,8 @@ static void show_packets(WriterContext *w, AVFormatContext *fmt_ctx)
         if (do_show_frames &&
             get_video_frame(fmt_ctx, &frame, &pkt)) {
             show_frame(w, &frame, fmt_ctx->streams[pkt.stream_index]);
-            av_free_packet(&pkt);
         }
+        av_free_packet(&pkt);
     }
     av_init_packet(&pkt);
     pkt.data = NULL;