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

Michael Niedermayer michael at niedermayer.cc
Wed Feb 24 16:10:00 CET 2016


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

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/avpacket.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 10be9d5..ad0a7d7 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;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list