summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2016-11-22 16:56:04 +0100
committerEdward Hervey <bilboed@bilboed.com>2016-11-22 18:21:46 +0100
commite7ff86665a8e2c77a676546accf07f44b005f0dc (patch)
tree4f57ab8f338c102babe457bc4fa5c9f58d7cda9b
parentcc04255e946f28acb4a60cc570c0c460c2f0154f (diff)
asfdemux: FILE headers are mandatory in the header
As per the specification, also avoids ending up trying to play a file with plenty of un-initialized values. https://bugzilla.gnome.org/show_bug.cgi?id=774846
-rw-r--r--gst/asfdemux/gstasfdemux.c9
-rw-r--r--gst/asfdemux/gstasfdemux.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index c9d7c370..09168a8c 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -3575,7 +3575,7 @@ gst_asf_demux_process_header (GstASFDemux * demux, guint8 * data, guint64 size)
unknown = gst_asf_demux_get_uint8 (&data, &size);
GST_INFO_OBJECT (demux, "object is a header with %u parts", num_objects);
-
+ demux->saw_file_header = FALSE;
/* Loop through the header's objects, processing those */
for (i = 0; i < num_objects; ++i) {
GST_INFO_OBJECT (demux, "reading header part %u", i);
@@ -3585,6 +3585,11 @@ gst_asf_demux_process_header (GstASFDemux * demux, guint8 * data, guint64 size)
break;
}
}
+ if (!demux->saw_file_header) {
+ GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
+ ("Header does not have mandatory FILE section"));
+ return GST_FLOW_ERROR;
+ }
return ret;
@@ -3665,6 +3670,8 @@ gst_asf_demux_process_file (GstASFDemux * demux, guint8 * data, guint64 size)
packets_count);
GST_INFO ("preroll = %" G_GUINT64_FORMAT, demux->preroll);
+ demux->saw_file_header = TRUE;
+
return GST_FLOW_OK;
/* ERRORS */
diff --git a/gst/asfdemux/gstasfdemux.h b/gst/asfdemux/gstasfdemux.h
index 0e8ad852..953b4963 100644
--- a/gst/asfdemux/gstasfdemux.h
+++ b/gst/asfdemux/gstasfdemux.h
@@ -240,6 +240,8 @@ struct _GstASFDemux {
/* parsing 3D */
GstASF3DMode asf_3D_mode;
+
+ gboolean saw_file_header;
};
struct _GstASFDemuxClass {