You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i found 2 unhandled panics in the library below which causes a crash in the program using the library when i encounter malformed conditions like weird encodings:
(a) id3.go, line 78: panic(fmt.Sprintf("Unrecognized ID3v2 version: %d", file.Header.Version))
(b) util.go, line 156: panic(err)
My current retrofit for the Read function is to add a defer with a recover & return nil instead of *File. However, i believe a better solution would be to return both a File & a more descriptive error object
func Read(reader io.Reader) (retfil *File) {
defer func() {
if r := recover(); r != nil {
retfil = nil
}
}()
.....
.....
}
The text was updated successfully, but these errors were encountered:
HI,
i found 2 unhandled panics in the library below which causes a crash in the program using the library when i encounter malformed conditions like weird encodings:
(a) id3.go, line 78: panic(fmt.Sprintf("Unrecognized ID3v2 version: %d", file.Header.Version))
(b) util.go, line 156: panic(err)
My current retrofit for the Read function is to add a defer with a recover & return nil instead of *File. However, i believe a better solution would be to return both a File & a more descriptive error object
func Read(reader io.Reader) (retfil *File) {
defer func() {
if r := recover(); r != nil {
retfil = nil
}
}()
.....
.....
}
The text was updated successfully, but these errors were encountered: