mpegts: unref buffer in reset_pes_packet_state
authorMarton Balint <cus@passwd.hu>
Fri, 2 May 2014 15:13:27 +0000 (17:13 +0200)
committerMarton Balint <cus@passwd.hu>
Mon, 5 May 2014 20:33:52 +0000 (22:33 +0200)
Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/mpegts.c

index 1bd697a..7ed7bb4 100644 (file)
@@ -791,9 +791,9 @@ static void reset_pes_packet_state(PESContext *pes)
 {
     pes->pts        = AV_NOPTS_VALUE;
     pes->dts        = AV_NOPTS_VALUE;
-    pes->buffer     = NULL;
     pes->data_index = 0;
     pes->flags      = 0;
+    av_buffer_unref(&pes->buffer);
 }
 
 static void new_pes_packet(PESContext *pes, AVPacket *pkt)
@@ -823,6 +823,7 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
     pkt->pos   = pes->ts_packet_pos;
     pkt->flags = pes->flags;
 
+    pes->buffer = NULL;
     reset_pes_packet_state(pes);
 }