diff --git a/sam.c b/sam.c index 7e58da6e7..a96a6120d 100644 --- a/sam.c +++ b/sam.c @@ -4856,9 +4856,9 @@ static inline uint8_t *skip_aux(uint8_t *s, uint8_t *end) switch (size) { case 'Z': case 'H': - while (s < end && *s) ++s; - return s < end ? s + 1 : end; - case 'B': + s = memchr(s, 0, end-s); + return s ? s+1 : end; + case 'B': if (end - s < 5) return NULL; size = aux_type2size(*s); ++s; n = le_to_u32(s);