[MPlayer-cvslog] r38385 - trunk/libmpdemux/demux_mov.c
reimar
subversion at mplayerhq.hu
Fri Aug 26 18:46:02 EEST 2022
Author: reimar
Date: Fri Aug 26 18:46:02 2022
New Revision: 38385
Log:
demux_mov.c: robustness fixes.
Pick a default timescale if the one in the file is broken,
which at least avoids division by 0 or timestamps
going backwards.
Also handle broken edit lists with too large pts values
that would overread the array by 1.
Fixes trac issues #2396 and #2397.
Modified:
trunk/libmpdemux/demux_mov.c
Modified: trunk/libmpdemux/demux_mov.c
==============================================================================
--- trunk/libmpdemux/demux_mov.c Fri Aug 26 17:29:59 2022 (r38384)
+++ trunk/libmpdemux/demux_mov.c Fri Aug 26 18:46:02 2022 (r38385)
@@ -298,6 +298,10 @@ static void mov_build_index(mov_track_t*
for(;sample<trak->samples_size;sample++){
if(pts<=trak->samples[sample].pts) break;
}
+ if (sample >= trak->samples_size){
+ // skip!
+ el->frames=0; continue;
+ }
el->start_sample=sample;
el->pts_offset=((long long)e_pts*(long long)trak->timescale)/(long long)timescale-trak->samples[sample].pts;
pts+=((long long)el->dur*(long long)trak->timescale)/(long long)timescale;
@@ -1315,6 +1319,10 @@ static void lschunks(demuxer_t* demuxer,
int version = stream_read_char(demuxer->stream);
stream_skip(demuxer->stream, (version == 1) ? 19 : 11);
priv->timescale=stream_read_dword(demuxer->stream);
+ if (priv->timescale <= 0) {
+ priv->timescale = 600;
+ mp_msg(MSGT_DEMUX, MSGL_INFO,"MOV: invalid timescale, defaulting to %i\n", priv->timescale);
+ }
if (version == 1)
priv->duration=stream_read_qword(demuxer->stream);
else
More information about the MPlayer-cvslog
mailing list