[FFmpeg-cvslog] libavformat/flvdec.c: free always the packet after a resync.

Thierry Foucu git at videolan.org
Tue Sep 29 04:45:50 CEST 2015


ffmpeg | branch: master | Thierry Foucu <tfoucu at gmail.com> | Mon Sep 28 14:34:45 2015 -0700| [7f72f2d75e581abfe016600d003d1bbab99714f0] | committer: Michael Niedermayer

libavformat/flvdec.c: free always the packet after a resync.

In case of resync, always free the packet, but retry only if the resync
did not get to the end of the file. Otherwise, there is a memory leak when the
last packet in the file is corrupted.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f72f2d75e581abfe016600d003d1bbab99714f0
---

 libavformat/flvdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 16d25e9..a59c07d 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1142,8 +1142,8 @@ leave:
         av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d\n", last, orig_size + 11);
         avio_seek(s->pb, pos + 1, SEEK_SET);
         ret = resync(s);
+        av_free_packet(pkt);
         if (ret >= 0) {
-            av_free_packet(pkt);
             goto retry;
         }
     }



More information about the ffmpeg-cvslog mailing list