static int atom_cmp(const unsigned char *buf1, const char *buf2)
{
- const unsigned char *b2 = (unsigned char *)buf2;
-
- if (buf1[0] != b2[0])
- return 1;
- if (buf1[1] != b2[1])
- return 1;
- if (buf1[2] != b2[2])
- return 1;
- if (buf1[3] != b2[3])
- return 1;
- return 0;
+ return memcmp(buf1, buf2, 4)? 1 : 0;
}
static int read_atom_header(unsigned char *buf, uint64_t *subsize, unsigned char type[5])
{
int i;
- uint64_t size = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
+ uint64_t size = aac_read_int32(buf);
memcpy(type, buf + 4, 4);
type[4] = '\0';