From e596a3b6a77ba65e00b0f14d217b58a9d0a6d28b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 29 Dec 2014 15:00:02 +0100 Subject: [PATCH] matroskademux: Don't get stuck at the same offset when searching for clusters This could happen if there is an invalid cluster with size 0, and in that case just error out instead of looping forever. --- gst/matroska/matroska-demux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index cdecceb..9b2bb0a 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -1610,6 +1610,11 @@ gst_matroska_demux_search_cluster (GstMatroskaDemux * demux, gint64 * pos) GST_DEBUG_OBJECT (demux, "cluster is first cluster -> OK"); break; } + if (newpos == demux->common.offset) { + GST_ERROR_OBJECT (demux, "Stuck at the same offset"); + ret = GST_FLOW_ERROR; + goto exit; + } demux->common.offset = newpos; ret = gst_matroska_read_common_peek_id_length_pull (&demux->common, GST_ELEMENT_CAST (demux), &id, &length, &needed); -- 2.7.4