[FFmpeg-cvslog] yop: Clear all references to the AVBuffer in the local AVPacket

Martin Storsjö git at videolan.org
Fri Sep 20 14:42:48 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Sep 19 16:49:48 2013 +0300| [d8b68660145c76a23fc9665f96932449514ecad2] | committer: Martin Storsjö

yop: Clear all references to the AVBuffer in the local AVPacket

This makes sure that it doesn't try to free an AVBuffer belonging
to an earlier packet when we free the local packet at the end.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8b68660145c76a23fc9665f96932449514ecad2
---

 libavformat/yop.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/yop.c b/libavformat/yop.c
index 5fe6bdc..8caeb07 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -127,6 +127,12 @@ static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
     if (yop->video_packet.data) {
         *pkt                   =  yop->video_packet;
         yop->video_packet.data =  NULL;
+        yop->video_packet.buf  =  NULL;
+#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
+        yop->video_packet.destruct = NULL;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         yop->video_packet.size =  0;
         pkt->data[0]           =  yop->odd_frame;
         pkt->flags             |= AV_PKT_FLAG_KEY;



More information about the ffmpeg-cvslog mailing list