If an unknown type byte is encountered, the offset isn't incremented, resulting in an infinite loop. We now return an error instead.
Although the settings sample will most likely always be located at the start, it's better to be on the safe side and use an offset relative to the start of the settings sample. Reported-By: Nick Shore <support@mac-dive.com>