[FFmpeg-cvslog] avcodec/avpacket: clear priv in av_init_packet()

Michael Niedermayer git at videolan.org
Sat Apr 30 03:36:38 CEST 2016


ffmpeg | branch: release/2.6 | Michael Niedermayer <michael at niedermayer.cc> | Wed Feb 24 15:48:28 2016 +0100| [97da8f43a4e97322081a17ff4510a7274c0c4da6] | committer: Michael Niedermayer

avcodec/avpacket: clear priv in av_init_packet()

This should fix leaving uninitialized pointers in priv which can confuse
user applications.
See: https://github.com/golang/go/issues/14426

Only or release branches

Reviewed-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/avpacket.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 22a2d5d..38f6ae1 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -58,6 +58,7 @@ void av_init_packet(AVPacket *pkt)
 #if FF_API_DESTRUCT_PACKET
 FF_DISABLE_DEPRECATION_WARNINGS
     pkt->destruct             = NULL;
+    pkt->priv                 = NULL;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
     pkt->buf                  = NULL;



More information about the ffmpeg-cvslog mailing list