summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorThierry Foucu <tfoucu@gmail.com>2015-09-28 14:34:45 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-29 04:01:50 +0200
commit7f72f2d75e581abfe016600d003d1bbab99714f0 (patch)
tree12a1396869861723df9a69a950b151e26ba297a6 /libavformat
parent1d0487f77f07663c510207eb6e946675b71823cb (diff)
downloadffmpeg-streaming-7f72f2d75e581abfe016600d003d1bbab99714f0.zip
ffmpeg-streaming-7f72f2d75e581abfe016600d003d1bbab99714f0.tar.gz
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@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvdec.c2
1 files changed, 1 insertions, 1 deletions
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;
}
}
OpenPOWER on IntegriCloud