1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2012-09-08 04:32:25 +02:00
parent 9a27fd12f3
commit 5710dbf88c

View File

@ -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) {