[vlc-commits] demux: ts: don't return invalid length
Francois Cartegnie
git at videolan.org
Thu Feb 25 09:55:35 UTC 2021
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 29 16:45:44 2021 +0100| [a8d6a2f10a95f8a95f72a38575d3d73d05983f0e] | committer: Francois Cartegnie
demux: ts: don't return invalid length
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a8d6a2f10a95f8a95f72a38575d3d73d05983f0e
---
modules/demux/mpeg/ts.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index cc0edb2371..6361715cc6 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -1072,6 +1072,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_pmt->pcr.i_first_dts;
stime_t i_last = TimeStampWrapAround( p_pmt->pcr.i_first, p_pmt->i_last_dts );
i_last += p_pmt->pcr.i_pcroffset;
+ if( i_start > i_last )
+ {
+ msg_Warn( p_demux, "Can't get stream duration. Edited ?" );
+ return VLC_EGENERIC;
+ }
*va_arg( args, vlc_tick_t * ) = FROM_SCALE(i_last - i_start);
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list