Skip to content

Commit

Permalink
Recover from panic when reading invalid id2 tags
Browse files Browse the repository at this point in the history
Workaround for #596
  • Loading branch information
deluan committed Oct 30, 2020
1 parent cdd44a2 commit 4d6c948
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scanner/metadata/taglib.go
Expand Up @@ -59,6 +59,11 @@ func (e *taglibExtractor) extractMetadata(filePath string) (*taglibMetadata, err
}

func hasEmbeddedImage(path string) bool {
defer func() {
if r := recover(); r != nil {
log.Error("Panic while checking for images. Please report this error with a copy of the file", "path", path, r)
}
}()
f, err := os.Open(path)
if err != nil {
log.Warn("Error opening file", "filePath", path, err)
Expand Down

0 comments on commit 4d6c948

Please sign in to comment.