avprobe: Unref the packet once it is used
authorLuca Barbato <lu_zero@gentoo.org>
Fri, 23 Oct 2015 09:11:29 +0000 (11:11 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 26 Oct 2015 17:00:54 +0000 (18:00 +0100)
Make sure it does not leak packets.

CC: libav-stable@libav.org
avprobe.c

index a83fa68..2ab8ce0 100644 (file)
--- a/avprobe.c
+++ b/avprobe.c
@@ -589,8 +589,10 @@ static void show_packets(AVFormatContext *fmt_ctx)
 
     av_init_packet(&pkt);
     probe_array_header("packets", 0);
-    while (!av_read_frame(fmt_ctx, &pkt))
+    while (!av_read_frame(fmt_ctx, &pkt)) {
         show_packet(fmt_ctx, &pkt);
+        av_packet_unref(&pkt);
+    }
     probe_array_footer("packets", 0);
 }