rwcarlsen / goexif

Decode embedded EXIF meta data from image files.
BSD 2-Clause "Simplified" License
627 stars 134 forks source link

Getting a slice bounds out of range in mknote #73

Open robrotheram opened 5 years ago

robrotheram commented 5 years ago

This might relate to issue #72 I getting a a slice bounds out of range when trying to decode exif This was working about 2 weeks ago but failed when I updated today.

For reference here one of the images that caused the error https://drive.google.com/file/d/1FfKz6CqIS-3XEMeulHyj1uhLmGZiQWNJ/view?usp=sharing

github.com/robrotheram/gogallery/vendor/github.com/rwcarlsen/goexif/mknote.(*nikonV3).Parse(0x107f000, 0xc00e4024c0, 0x0, 0x0)
    /home/travis/gopath/src/github.com/robrotheram/gogallery/vendor/github.com/rwcarlsen/goexif/mknote/mknote.go:57 +0x2b0
github.com/robrotheram/gogallery/vendor/github.com/rwcarlsen/goexif/exif.LazyDecode(0xba1ce0, 0xc00e400570, 0xc00dacc470, 0x10513c0, 0x20)
    /home/travis/gopath/src/github.com/robrotheram/gogallery/vendor/github.com/rwcarlsen/goexif/exif/exif.go:297 +0x255
github.com/robrotheram/gogallery/vendor/github.com/rwcarlsen/goexif/exif.Decode(0xba23c0, 0xc00e408088, 0x2, 0x19, 0x10513c0)
    /home/travis/gopath/src/github.com/robrotheram/gogallery/vendor/github.com/rwcarlsen/goexif/exif/exif.go:222 +0x6e
github.com/robrotheram/gogallery/datastore.(*Picture).CreateExif(0xc00e3fedd0)
    /home/travis/gopath/src/github.com/robrotheram/gogallery/datastore/pictures.go:106 +0x182
github.com/robrotheram/gogallery/datastore.ScanPath.func1(0xc00e39b830, 0x22, 0xbab740, 0xc00e3fed00, 0x0, 0x0, 0xc, 0xc00ad53cc8)
    /home/travis/gopath/src/github.com/robrotheram/gogallery/datastore/scan.go:83 +0x4c1
path/filepath.walk(0xc00e39b830, 0x22, 0xbab740, 0xc00e3fed00, 0xb1a680, 0x0, 0x0)
    /home/travis/.gimme/versions/go1.11.6.linux.amd64/src/path/filepath/path.go:358 +0x41c
path/filepath.walk(0xc00e404420, 0x15, 0xbab740, 0xc00e3feb60, 0xb1a680, 0x0, 0x0)
    /home/travis/.gimme/versions/go1.11.6.linux.amd64/src/path/filepath/path.go:382 +0x2fe
path/filepath.walk(0xc000024017, 0xd, 0xbab740, 0xc00013c0d0, 0xb1a680, 0x0, 0xc005531f18)
    /home/travis/.gimme/versions/go1.11.6.linux.amd64/src/path/filepath/path.go:382 +0x2fe
path/filepath.Walk(0xc000024017, 0xd, 0xb1a680, 0xd, 0x0)
    /home/travis/.gimme/versions/go1.11.6.linux.amd64/src/path/filepath/path.go:404 +0x105
github.com/robrotheram/gogallery/datastore.ScanPath(0xc000024017, 0xd, 0x0, 0x0, 0x0)
    /home/travis/gopath/src/github.com/robrotheram/gogallery/datastore/scan.go:105 +0x160
main.main.func1()
    /home/travis/gopath/src/github.com/robrotheram/gogallery/main.go:59 +0x40
created by main.main
    /home/travis/gopath/src/github.com/robrotheram/gogallery/main.go:58 +0x2d5
rwcarlsen commented 5 years ago

I've reverted the lazy decoder commit for now. Let's leave this and #72 up to help diagnose problems in PR #60.