aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-08 04:32:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-08 05:21:47 +0200
commit5710dbf88cd56e7fbee7ad70240f92fe82ce6566 (patch)
treea49ec513fdd3180aad43b836b84f3a3f221dd4e9 /libavformat/mpegts.c
parent9a27fd12f3bb389db6ea17127b268dfbba74dbc3 (diff)
downloadffmpeg-5710dbf88cd56e7fbee7ad70240f92fe82ce6566.tar.gz
mpegts: Fix potential memory leak in mpegts_read_packet()
This leak can happen in case of some error paths. Found-by: Tanami, Ohad Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 4492c5bfef..04e10b6413 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2066,6 +2066,7 @@ static int mpegts_read_packet(AVFormatContext *s,
ts->pkt = pkt;
ret = handle_packets(ts, 0);
if (ret < 0) {
+ av_free_packet(ts->pkt);
/* flush pes data left */
for (i = 0; i < NB_PID_MAX; i++) {
if (ts->pids[i] && ts->pids[i]->type == MPEGTS_PES) {