mirror of https://github.com/dsoprea/go-exif.git
exif.go: Check for a long-enough EXIF header when searching.
parent
5409475851
commit
bf0b550eff
5
exif.go
5
exif.go
|
@ -142,6 +142,11 @@ func ParseExifHeader(data []byte) (eh ExifHeader, err error) {
|
||||||
// CIPA DC-008-2016; JEITA CP-3451D
|
// CIPA DC-008-2016; JEITA CP-3451D
|
||||||
// -> http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf
|
// -> http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf
|
||||||
|
|
||||||
|
if len(data) < 8 {
|
||||||
|
exifLogger.Warningf(nil, "Not enough data for EXIF header: (%d)", len(data))
|
||||||
|
log.Panic(ErrNoExif)
|
||||||
|
}
|
||||||
|
|
||||||
byteOrderBytes := [2]byte{data[0], data[1]}
|
byteOrderBytes := [2]byte{data[0], data[1]}
|
||||||
|
|
||||||
byteOrder, found := ByteOrderLookup[byteOrderBytes]
|
byteOrder, found := ByteOrderLookup[byteOrderBytes]
|
||||||
|
|
Loading…
Reference in New Issue