Skip to content

Commit

Permalink
Merge pull request #37 from bastengao/fix-bad-url
Browse files Browse the repository at this point in the history
Fix ProbeData.Format maybe nil if ffprobe output is empty
  • Loading branch information
vansante authored Sep 9, 2022
2 parents 8a94d91 + b391d75 commit ffed76e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ffprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func runProbe(cmd *exec.Cmd) (data *ProbeData, err error) {
return data, fmt.Errorf("error parsing ffprobe output: %w", err)
}

if data.Format == nil {
return data, fmt.Errorf("no format data found in ffprobe output")
}

// Populate the old Tags structs for backwards compatibility purposes:
if len(data.Format.TagList) > 0 {
data.Format.Tags = &FormatTags{}
Expand Down

0 comments on commit ffed76e

Please sign in to comment.