fix(ffmpeg): fix SIGSEGV on seek duration for invalid coded (#70)

* fix(ffmpeg): fix SIGSEGV on seek duration for invalid coded

* test: update golden files
This commit is contained in:
Adrian Shum 2023-07-26 21:46:57 +08:00 committed by GitHub
parent d824dba7d5
commit c8024af62f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View file

@ -132,6 +132,9 @@ func (av *AVContext) SeekPosition(f float64) error {
// SeekDuration seeks to keyframe before the specified duration
func (av *AVContext) SeekDuration(ts time.Duration) error {
if av.formatContext == nil || av.codecContext == nil {
return ErrDecoderNotFound
}
return seekDuration(av, ts)
}