const char **buf, uint32_t *len)
{
struct aac_afh_context *c = afh_context;
- int32_t ss;
+ uint32_t ss;
size_t offset;
int ret;
if (ret < 0)
return ret;
offset = c->fpos;
- ss = mp4_get_sample_size(c->mp4, chunk_num);
- if (ss <= 0)
- return -E_MP4_BAD_SAMPLE;
+ ret = mp4_get_sample_size(c->mp4, chunk_num, &ss);
+ if (ret < 0)
+ return ret;
assert(ss + offset <= c->mapsize);
*buf = c->map + offset;
*len = ss;