avformat/movenc: disallow buggy flags combination
Use of hybrid_fragmented and faststart together can result in files with loss of sync and bitstream parsing errors upon playback.
This commit is contained in:
parent
eda0ac7e5f
commit
c79bce92b8
1 changed files with 6 additions and 0 deletions
|
|
@ -7731,6 +7731,12 @@ static int mov_init(AVFormatContext *s)
|
|||
FF_MOV_FLAG_FRAG_EVERY_FRAME))
|
||||
mov->flags |= FF_MOV_FLAG_FRAGMENT;
|
||||
|
||||
if (mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED &&
|
||||
mov->flags & FF_MOV_FLAG_FASTSTART) {
|
||||
av_log(s, AV_LOG_ERROR, "Setting both hybrid_fragmented and faststart is not supported.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
/* Set other implicit flags immediately */
|
||||
if (mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED)
|
||||
mov->flags |= FF_MOV_FLAG_FRAGMENT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue