]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/avpacket.c
Merge commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f'
[ffmpeg] / libavcodec / avpacket.c
index 516f1c972b9cb2b36d4f0bbc06a19d2a67b8340d..dea72e5d73194ecf1323db81462041ae422506ba 100644 (file)
@@ -41,8 +41,6 @@ void av_destruct_packet(AVPacket *pkt)
     av_free(pkt->data);
     pkt->data = NULL;
     pkt->size = 0;
-
-    ff_packet_free_side_data(pkt);
 }
 
 void av_init_packet(AVPacket *pkt)
@@ -174,11 +172,16 @@ int av_copy_packet(AVPacket *dst, AVPacket *src)
 void av_free_packet(AVPacket *pkt)
 {
     if (pkt) {
+        int i;
+
         if (pkt->destruct)
             pkt->destruct(pkt);
         pkt->data            = NULL;
         pkt->size            = 0;
-        pkt->side_data       = NULL;
+
+        for (i = 0; i < pkt->side_data_elems; i++)
+            av_free(pkt->side_data[i].data);
+        av_freep(&pkt->side_data);
         pkt->side_data_elems = 0;
     }
 }