summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2018-03-17 06:33:38 +0100
committerEdward Hervey <bilboed@bilboed.com>2018-03-17 06:39:18 +0100
commitf367edaec3fd24bdc514928588fd657b68acdc12 (patch)
tree90b950bcbdd6e28ff5ae6d1ab80c2afc87ca2087
parentd4f91f4bbf5b38e74646ce870b19968953ad1e22 (diff)
downloadgstreamer-plugins-base-f367edaec3fd24bdc514928588fd657b68acdc12.tar.gz
oggstream: protect against out-of-bounds read
We need at least 17 bytes of data for a valid flac header oss-fuzz #6974
-rw-r--r--ext/ogg/gstoggstream.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c
index c8b2907d4..3ef379f6d 100644
--- a/ext/ogg/gstoggstream.c
+++ b/ext/ogg/gstoggstream.c
@@ -1050,6 +1050,9 @@ static gboolean
is_header_fLaC (GstOggStream * pad, ogg_packet * packet)
{
if (pad->n_header_packets_seen == 1) {
+ if (packet->bytes < 17)
+ return FALSE;
+
pad->granulerate_n = (packet->packet[14] << 12) |
(packet->packet[15] << 4) | ((packet->packet[16] >> 4) & 0xf);
}