diff --git a/vttdemux.cc b/vttdemux.cc index c9abd5c..52a2661 100644 --- a/vttdemux.cc +++ b/vttdemux.cc @@ -523,8 +523,10 @@ void vttdemux::CloseFiles(metadata_map_t* metadata_map) { metadata_map_t::value_type& v = *i++; MetadataInfo& info = v.second; - fclose(info.file); - info.file = NULL; + if (info.file != NULL) { + fclose(info.file); + info.file = NULL; + } } }