avcodec/avpacket: clear priv in av_init_packet()
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 24 Feb 2016 14:48:28 +0000 (15:48 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 28 Apr 2016 01:47:12 +0000 (03:47 +0200)
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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/avpacket.c

index aae67c5..b73cf21 100644 (file)
@@ -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;