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

Michael Niedermayer git at videolan.org
Thu Apr 28 05:29:16 CEST 2016


ffmpeg | branch: release/2.7 | Michael Niedermayer <michael at niedermayer.cc> | Wed Feb 24 15:48:28 2016 +0100| [c6950985cb91ba42a920fbd6d7ae6a9591c29728] | 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=c6950985cb91ba42a920fbd6d7ae6a9591c29728
---

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

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index aae67c5..b73cf21 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