[FFmpeg-cvslog] avprobe: Unref the packet once it is used
Luca Barbato
git at videolan.org
Tue Oct 27 14:10:56 CET 2015
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Fri Oct 23 11:11:29 2015 +0200| [f0ca6ffa0ae5d5564516ee7a18aa1e234751444a] | committer: Luca Barbato
avprobe: Unref the packet once it is used
Make sure it does not leak packets.
CC: libav-stable at libav.org
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0ca6ffa0ae5d5564516ee7a18aa1e234751444a
---
avprobe.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/avprobe.c b/avprobe.c
index a83fa68..2ab8ce0 100644
--- 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);
}
More information about the ffmpeg-cvslog
mailing list