av_free_packet SEGV fix by (Arthur van Hoff (javanator))
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Jul 2003 23:48:20 +0000 (23:48 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Jul 2003 23:48:20 +0000 (23:48 +0000)
Originally committed as revision 2013 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/avformat.h

index 29ca987..e4748be 100644 (file)
@@ -45,7 +45,9 @@ int av_new_packet(AVPacket *pkt, int size);
  */
 static inline void av_free_packet(AVPacket *pkt)
 {
-    pkt->destruct(pkt);
+    if (pkt && pkt->destruct) {
+       pkt->destruct(pkt);
+    }
 }
 
 /*************************************************/