Merge "vendor: update github.com/rwcarlsen/goexif"

This commit is contained in:
Mathieu Lonjaret 2018-05-18 19:20:30 +00:00 committed by Gerrit Code Review
commit f7a98b698c
2 changed files with 10 additions and 4 deletions

3
Gopkg.lock generated
View File

@ -263,7 +263,7 @@
"exif",
"tiff"
]
revision = "fb35d3c3290d09f3524b684b5d42d0063c227158"
revision = "8d986c03457a2057c7b0fb0a48113f7dd48f9619"
[[projects]]
branch = "master"
@ -349,7 +349,6 @@
"curve25519",
"ed25519",
"ed25519/internal/edwards25519",
"internal/chacha20",
"nacl/secretbox",
"openpgp",
"openpgp/armor",

View File

@ -179,8 +179,15 @@ func (t *Tag) convertVals() error {
switch t.Type {
case DTAscii:
if len(t.Val) > 0 {
t.strVal = string(t.Val[:len(t.Val)-1]) // ignore the last byte (NULL).
if len(t.Val) <= 0 {
break
}
nullPos := bytes.IndexByte(t.Val, 0)
if nullPos == -1 {
t.strVal = string(t.Val)
} else {
// ignore all trailing NULL bytes, in case of a broken t.Count
t.strVal = string(t.Val[:nullPos])
}
case DTByte:
var v uint8