mirror of https://github.com/dsoprea/go-exif.git
ifd_enumerate.go: Do not allow unnecessary thumbnail read to disrupt enumeration
parent
3a80916d1f
commit
33ee3a8313
|
@ -486,8 +486,11 @@ func (ie *IfdEnumerate) parseIfd(ii *exifcommon.IfdIdentity, bp *byteParser, vis
|
||||||
|
|
||||||
if enumeratorThumbnailOffset != nil && enumeratorThumbnailSize != nil {
|
if enumeratorThumbnailOffset != nil && enumeratorThumbnailSize != nil {
|
||||||
thumbnailData, err = ie.parseThumbnail(enumeratorThumbnailOffset, enumeratorThumbnailSize)
|
thumbnailData, err = ie.parseThumbnail(enumeratorThumbnailOffset, enumeratorThumbnailSize)
|
||||||
log.PanicIf(err)
|
if err != nil {
|
||||||
|
ifdEnumerateLogger.Errorf(
|
||||||
|
nil, err,
|
||||||
|
"We tried to bump our furthest-offset counter but there was an issue first seeking past the thumbnail.")
|
||||||
|
} else {
|
||||||
// In this case, the value is always an offset.
|
// In this case, the value is always an offset.
|
||||||
offset := enumeratorThumbnailOffset.getValueOffset()
|
offset := enumeratorThumbnailOffset.getValueOffset()
|
||||||
|
|
||||||
|
@ -502,6 +505,7 @@ func (ie *IfdEnumerate) parseIfd(ii *exifcommon.IfdIdentity, bp *byteParser, vis
|
||||||
ie.furthestOffset = furthestOffset
|
ie.furthestOffset = furthestOffset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nextIfdOffset, _, err = bp.getUint32()
|
nextIfdOffset, _, err = bp.getUint32()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
|
|
Loading…
Reference in New Issue