avformat/utils: fix memleak with nobuffer
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Aug 2013 23:14:45 +0000 (01:14 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Aug 2013 23:21:43 +0000 (01:21 +0200)
Fixes Ticket2802

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index f9edcca..727711b 100644 (file)
@@ -2783,9 +2783,9 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
             break;
         }
 
-        if (ic->flags & AVFMT_FLAG_NOBUFFER) {
-            pkt = &pkt1;
-        } else {
+        if (ic->flags & AVFMT_FLAG_NOBUFFER)
+            free_packet_buffer(&ic->packet_buffer, &ic->packet_buffer_end);
+        {
             pkt = add_to_pktbuf(&ic->packet_buffer, &pkt1,
                                 &ic->packet_buffer_end);
             if (!pkt) {