diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index a87e8e3ead..9978712bb8 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -34,8 +34,7 @@ void av_destruct_packet(AVPacket *pkt) { - av_free(pkt->data); - pkt->data = NULL; + av_freep(&pkt->data); pkt->size = 0; }