From 06e2d2791b7a6e835e1e40d29d1e74cd571567ed Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 21 Jan 2010 17:31:13 +0100 Subject: [PATCH] oggstream: don't call NULL setup functions If we find a known mapper but it doesn't have a setup function, simply skip it instead of crashing. --- ext/ogg/gstoggstream.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c index 3057167..d0c9fa3 100644 --- a/ext/ogg/gstoggstream.c +++ b/ext/ogg/gstoggstream.c @@ -1282,7 +1282,14 @@ gst_ogg_stream_setup_map (GstOggStream * pad, ogg_packet * packet) if (packet->bytes >= mappers[i].min_packet_size && packet->bytes >= mappers[i].id_length && memcmp (packet->packet, mappers[i].id, mappers[i].id_length) == 0) { - ret = mappers[i].setup_func (pad, packet); + + GST_DEBUG ("found mapper for '%s'", mappers[i].id); + + if (mappers[i].setup_func) + ret = mappers[i].setup_func (pad, packet); + else + continue; + if (ret) { GST_DEBUG ("got stream type %" GST_PTR_FORMAT, pad->caps); pad->map = i; -- 2.7.4