]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsevorbis.c
Merge commit 'f61272f0efd80da437570aad2c40e00f9d3f4fe6'
[ffmpeg] / libavformat / oggparsevorbis.c
index 7e8f6cede3bf1605203eac6a9619209b437caf6f..16bcaefd4d6b6a24f019faf21a24ec871172faf1 100644 (file)
@@ -192,6 +192,16 @@ fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv,
     return offset;
 }
 
+static void vorbis_cleanup(AVFormatContext *s, int idx)
+{
+    struct ogg *ogg = s->priv_data;
+    struct ogg_stream *os = ogg->streams + idx;
+    struct oggvorbis_private *priv = os->private;
+    int i;
+    if (os->private)
+        for (i = 0; i < 3; i++)
+            av_freep(&priv->packet[i]);
+}
 
 static int
 vorbis_header (AVFormatContext * s, int idx)
@@ -373,5 +383,6 @@ const struct ogg_codec ff_vorbis_codec = {
     .magicsize = 7,
     .header = vorbis_header,
     .packet = vorbis_packet,
+    .cleanup= vorbis_cleanup,
     .nb_header = 3,
 };