return ret;
// goto start of image data
- next = ptr + strcspn(ptr, "{");
- if (!*next)
- next = ptr + strcspn(ptr, "(");
- if (!*next)
+ next = memchr(ptr, '{', avpkt->size);
+ if (!next)
+ next = memchr(ptr, '(', avpkt->size);
+ if (!next)
return AVERROR_INVALIDDATA;
ptr = next + 1;
for (j = 0; j < linesize; j++) {
uint8_t val;
- ptr += strcspn(ptr, "x$") + 1;
+ while (ptr < end && *ptr != 'x' && *ptr != '$')
+ ptr++;
+
+ ptr ++;
if (ptr < end && av_isxdigit(*ptr)) {
val = convert(*ptr++);
if (av_isxdigit(*ptr))