aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-08 23:40:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 01:23:56 +0100
commitcbfd34246cdddc58a627dd10fc563245601b2162 (patch)
treeee969280cbca830b4279fdbb862bfc486b7a6932
parentfeef77ec3a88baa830cfe71a17fe857339cc3ea3 (diff)
downloadffmpeg-cbfd34246cdddc58a627dd10fc563245601b2162.tar.gz
mpegts: do not return from ff_mpegts_parse_packet() after having seen the first PMT
It prevents leaving the AVPacket uninitialized. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit bc38e83793be5f7a184c88be55e556453a25224b) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpegts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index da8f228426..618bd8f1b4 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1862,10 +1862,8 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
len1 = len;
ts->pkt = pkt;
- ts->stop_parse = 0;
for(;;) {
- if (ts->stop_parse>0)
- break;
+ ts->stop_parse = 0;
if (len < TS_PACKET_SIZE)
return -1;
if (buf[0] != 0x47) {
@@ -1875,6 +1873,8 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
handle_packet(ts, buf);
buf += TS_PACKET_SIZE;
len -= TS_PACKET_SIZE;
+ if (ts->stop_parse == 1)
+ break;
}
}
return len1 - len;