const char pattern[] = {0x40, 0x9e, 0x69, 0xf8};
const char *p = search_pattern(pattern, sizeof(pattern), buf, len);
- if (!p) {
- PARA_NOTICE_LOG("audio stream guid not found");
- return -1;
- }
+ if (!p)
+ return -E_WMA_NO_GUID;
PARA_DEBUG_LOG("found audio stream guid@%0zx\n", p - buf);
return p - buf;
}
{
uint16_t header_len;
- if (len < 18)
- return -1;
header_len = read_u16(buf + 16) + 46;
if (header_len > len)
- return -2;
+ return -E_WMA_BAD_ASF_HEADER;
PARA_DEBUG_LOG("header_len: %d\n", header_len);
return header_len;
}