mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-17 13:27:46 -04:00
only call avformat_close_input if mformatContext still has a value. On falure it should have been freed and NULL'd
This commit is contained in:
@@ -362,9 +362,11 @@ int FfmpegCamera::OpenFfmpeg() {
|
||||
#if !LIBAVFORMAT_VERSION_CHECK(53, 17, 0, 25, 0)
|
||||
av_close_input_file( mFormatContext );
|
||||
#else
|
||||
avformat_close_input( &mFormatContext );
|
||||
if ( mFormatContext ) {
|
||||
avformat_close_input( &mFormatContext );
|
||||
mFormatContext = NULL;
|
||||
}
|
||||
#endif
|
||||
mFormatContext = NULL;
|
||||
av_dict_free(&opts);
|
||||
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user