large mp4 header handling

This commit is contained in:
Philippe G
2020-06-18 23:25:18 -07:00
parent b6aa8f9e96
commit 84190e7c6e
5 changed files with 68 additions and 5 deletions

View File

@@ -314,9 +314,15 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_
a->pos += bytes;
a->consume = consume - bytes;
break;
} else {
} else if (len > streambuf->size) {
// can't process an atom larger than streambuf!
LOG_ERROR("atom %s too large for buffer %u %u", type, len, streambuf->size);
return -1;
} else {
// make sure there is 'len' contiguous space
_buf_unwrap(streambuf, len);
break;
}
}
}
return 0;