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

avformat/mpegts: Ensure that mpegts_get_dts() only considers packets at or after the given position

This fixes an infinite loop
An alternative fix would be to revert d73cbc22c5
but that would worsen error resilience.

Found-by: Justin Ruggles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-04 00:55:38 +02:00
parent b78e75ebc9
commit a660991921

View File

@ -2362,7 +2362,7 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
if(pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0){
ff_reduce_index(s, pkt.stream_index);
av_add_index_entry(s->streams[pkt.stream_index], pkt.pos, pkt.dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
if(pkt.stream_index == stream_index){
if(pkt.stream_index == stream_index && pkt.pos >= *ppos){
*ppos= pkt.pos;
return pkt.dts;
}