oggstream: protect against out-of-bounds read
We need at least 17 bytes of data for a valid flac header oss-fuzz #6974
This commit is contained in:
parent
57516c5153
commit
17d5f08316
@ -1050,6 +1050,9 @@ static gboolean
|
|||||||
is_header_fLaC (GstOggStream * pad, ogg_packet * packet)
|
is_header_fLaC (GstOggStream * pad, ogg_packet * packet)
|
||||||
{
|
{
|
||||||
if (pad->n_header_packets_seen == 1) {
|
if (pad->n_header_packets_seen == 1) {
|
||||||
|
if (packet->bytes < 17)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
pad->granulerate_n = (packet->packet[14] << 12) |
|
pad->granulerate_n = (packet->packet[14] << 12) |
|
||||||
(packet->packet[15] << 4) | ((packet->packet[16] >> 4) & 0xf);
|
(packet->packet[15] << 4) | ((packet->packet[16] >> 4) & 0xf);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user