avformat: unref packet after storing it in internal packet queue
authorHendrik Leppkes <h.leppkes@gmail.com>
Sun, 1 Nov 2015 10:08:42 +0000 (11:08 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 2 Nov 2015 08:03:56 +0000 (09:03 +0100)
Fixes a memory leak when using genpts

libavformat/utils.c

index 3f82659..5c4d452 100644 (file)
@@ -1559,6 +1559,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
 
         ret = add_to_pktbuf(&s->internal->packet_buffer, pkt,
                             &s->internal->packet_buffer_end, 1);
+        av_packet_unref(pkt);
         if (ret < 0)
             return ret;
     }