Skip to content

Commit

Permalink
fix ffmpeg nil pointer crash (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
kira1928 authored Jul 10, 2024
1 parent 0c88ec6 commit 4f23b9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pkg/parser/ffmpeg/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (p *Parser) Stop() (err error) {
p.closeOnce.Do(func() {
p.cmdLock.Lock()
defer p.cmdLock.Unlock()
if p.cmd.ProcessState == nil {
if p.cmd != nil && p.cmd.ProcessState == nil {
if p.cmdStdIn != nil && p.cmd.Process != nil {
if _, err = p.cmdStdIn.Write([]byte("q")); err != nil {
err = fmt.Errorf("error sending stop command to ffmpeg: %v", err)
Expand Down

0 comments on commit 4f23b9b

Please sign in to comment.