Commit 8e34089e authored by Martin Storsjö's avatar Martin Storsjö

movenc: Check that frag_info entries exist in mov_write_sidx_tag

This fixes crashes with pathological cases when trying to write
a sidx index (via the -movflags faststart option, in combination
with fragmenting options), when no fragments actually have been
written. (This is possible if the empty_moov flag isn't used,
so that all actual packet data is written in the moov/mdat pair,
and no moof/mdat pairs have been written.)

In these pathological cases, no sidx should be written at all.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 1542ec96
......@@ -2751,6 +2751,8 @@ static int mov_write_sidx_tag(AVIOContext *pb,
}
} else {
entries = track->nb_frag_info;
if (entries <= 0)
return 0;
presentation_time = track->frag_info[0].time;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment