Prevent seg fault if mp4 fragment is not initialized

Related to #900.
This commit is contained in:
Sergio Garcia Murillo 2021-03-03 08:53:58 +01:00 committed by GitHub
parent 00af192626
commit b8ce44aba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,9 @@ Status Fragmenter::InitializeFragment(int64_t first_sample_dts) {
}
Status Fragmenter::FinalizeFragment() {
if (!fragment_initialized_)
return Status::OK;
if (stream_info_->is_encrypted()) {
Status status = FinalizeFragmentForEncryption();
if (!status.ok())