[FFmpeg-cvslog] yop: Do not keep a copy of parts of the returned packet

Michael Niedermayer git at videolan.org
Fri Mar 29 02:15:15 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 28 23:59:41 2013 +0100| [551f683861bbae1002542e70dc196244a1cd24ad] | committer: Michael Niedermayer

yop: Do not keep a copy of parts of the returned packet

Fixes double free
Regression since the new buffer references, thus no FFmpeg
releases should be affected

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/yop.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/yop.c b/libavformat/yop.c
index d1c0129..c84deea 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -135,8 +135,7 @@ 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.size =  0;
+        memset(&yop->video_packet, 0, sizeof(yop->video_packet));
         pkt->data[0]           =  yop->odd_frame;
         pkt->flags             |= AV_PKT_FLAG_KEY;
         yop->odd_frame         ^= 1;



More information about the ffmpeg-cvslog mailing list