summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2016-02-24 09:12:03 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-02-25 12:46:27 +0200
commitfb5d50cd07c4aa66d711e2cb0303637ab6d2f695 (patch)
tree8bf0b5f6908cc33aecb510b3dd8cb1c82d108490
parent459ef195bbc77cee5e407facc3172b77cb29d9a3 (diff)
downloadgstreamer-plugins-good-fb5d50cd07c4aa66d711e2cb0303637ab6d2f695.tar.gz
qtdemux: don't push encrypted buffer without cenc metadata
When the cenc metadata is stored outside of the moof box and the stream is exposed it is possible that the cenc metadata hasn't been processed yet while the first buffer is being pushed. When this happens the buffer can't possibly be decrypted downstream so don't push it. https://bugzilla.gnome.org/show_bug.cgi?id=762516
-rw-r--r--gst/isomp4/qtdemux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 20618a6d4..a7e188d6c 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4971,6 +4971,12 @@ gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux,
gst_pad_push_event (stream->pad, event);
}
+ if (qtdemux->cenc_aux_info_offset > 0 && info->crypto_info == NULL) {
+ GST_DEBUG_OBJECT (qtdemux, "cenc metadata hasn't been parsed yet");
+ gst_buffer_unref (buf);
+ goto exit;
+ }
+
index = stream->sample_index - (stream->n_samples - info->crypto_info->len);
if (G_LIKELY (index >= 0 && index < info->crypto_info->len)) {
/* steal structure from array */