From 46ce5c3737827915888b2618e1b1cba99900dcc2 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 22 Sep 2008 17:44:14 +0000 Subject: [PATCH] gst-libs/gst/tag/gsttagdemux.c: Fail to activate if there's insufficient data in the file to be usable, preventing an... Original commit message from CVS: * gst-libs/gst/tag/gsttagdemux.c: Fail to activate if there's insufficient data in the file to be usable, preventing an assertion fail later. Fixes #552960 --- ChangeLog | 6 ++++++ gst-libs/gst/tag/gsttagdemux.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1cbf88f9e9..a3838b13d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-22 Michael Smith + + * gst-libs/gst/tag/gsttagdemux.c: + Fail to activate if there's insufficient data in the file to be usable, + preventing an assertion fail later. Fixes #552960 + 2008-09-15 Tim-Philipp Müller * gst-libs/gst/pbutils/descriptions.c: diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c index 0709b7b636..b6a9b32485 100644 --- a/gst-libs/gst/tag/gsttagdemux.c +++ b/gst-libs/gst/tag/gsttagdemux.c @@ -1151,6 +1151,13 @@ gst_tag_demux_sink_activate (GstPad * sinkpad) demux->priv->send_tag_event = TRUE; } + if (demux->priv->upstream_size <= + demux->priv->strip_start + demux->priv->strip_end) { + /* There was no data (probably due to a truncated file) */ + GST_DEBUG_OBJECT (demux, "No data in file"); + return FALSE; + } + /* 3 - Do typefinding on data */ caps = gst_type_find_helper_get_range (GST_OBJECT (demux), (GstTypeFindHelperGetRangeFunction) gst_tag_demux_read_range,