void *ret = mmap(NULL, length, prot, flags, fd, offset);
if (ret != MAP_FAILED)
return ret;
-- PARA_EMERG_LOG("mmap failed: %s", strerror(errno));
++ PARA_EMERG_LOG("mmap failed: %s\n", strerror(errno));
++ PARA_EMERG_LOG("length: %zu, flags: %d, fd: %d, offset: %zu\n",
++ length, flags, fd, offset);
exit(EXIT_FAILURE);
}
return mode_text[h->mode];
}
+ static int header_channels(struct mp3header *h)
+ {
+ if (h->mode > 3)
+ return 0;
+ if (h->mode < 3)
+ return 2;
+ return 1;
+ }
+
static int header_bitrate(struct mp3header *h)
{
- if (h->layer > 3 || h->bitrate > 14)
+ if (!h->layer || h->layer > 3 || h->bitrate > 14 || !h->bitrate)
return -E_HEADER_BITRATE;
return mp3info_bitrate[h->version & 1][3 - h->layer][h->bitrate - 1];
}