diff options
-rw-r--r-- | libavformat/avformat.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 29ca9875d8..e4748bece2 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -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); + } } /*************************************************/ |