movenc: Require samples before trying to write edts

This avoids a potential crash if writing a fragmented psp mp4
(which probably is only a hypothetical scenario).

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2014-11-03 20:13:36 +02:00
parent 8cb7b7b461
commit 9a5ac36b69
1 changed files with 3 additions and 3 deletions

View File

@ -1771,9 +1771,9 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov,
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "trak");
mov_write_tkhd_tag(pb, mov, track, st);
if (track->mode == MODE_PSP || track->flags & MOV_TRACK_CTTS ||
(track->entry && track->cluster[0].dts) ||
is_clcp_track(track)) {
if (track->entry &&
(track->mode == MODE_PSP || track->flags & MOV_TRACK_CTTS ||
track->cluster[0].dts || is_clcp_track(track))) {
if (mov->use_editlist)
mov_write_edts_tag(pb, mov, track); // PSP Movies require edts box
else if ((track->entry && track->cluster[0].dts) || track->mode == MODE_PSP || is_clcp_track(track))