gst/asfdemux/: Error out when the stream is encrypted (rather than feeding garbage to the decoders). Fixes #349025.

Original commit message from CVS:
* gst/asfdemux/Makefile.am:
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasf.c: (plugin_init):
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_process_object):
Error out when the stream is encrypted (rather than feeding
garbage to the decoders). Fixes #349025.
This commit is contained in:
Tim-Philipp Müller 2006-07-28 15:15:15 +00:00
parent 287c94dcb0
commit 7a4e25d6e2
6 changed files with 50 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2006-07-28 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/Makefile.am:
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasf.c: (plugin_init):
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_process_object):
Error out when the stream is encrypted (rather than feeding
garbage to the decoders). Fixes #349025.
2006-07-28 Tim-Philipp Müller <tim at centricular dot net>
* Makefile.am:

View file

@ -1,7 +1,7 @@
plugin_LTLIBRARIES = libgstasf.la
libgstasf_la_SOURCES = gstasfdemux.c gstasf.c asfheaders.c
libgstasf_la_CFLAGS = $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
libgstasf_la_CFLAGS = $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstasf_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)\
-lgstriff-@GST_MAJORMINOR@
libgstasf_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)

View file

@ -119,6 +119,18 @@ const ASFGuidHash asf_object_guids[] = {
{ASF_OBJ_STREAM_PRIORITIZATION, "ASF_OBJ_STREAM_PRIORITIZATION",
{0xd4fed15b, 0x454f88d3, 0x5cedf081, 0x249e9945}
},
{ASF_OBJ_CONTENT_ENCRYPTION, "ASF_OBJ_CONTENT_ENCRYPTION",
{0x2211b3fb, 0x11d2bd23, 0xa000b7b4, 0x6efc55c9}
},
{ASF_OBJ_EXT_CONTENT_ENCRYPTION, "ASF_OBJ_EXT_CONTENT_ENCRYPTION",
{0x298ae614, 0x4c172622, 0xe0da35b9, 0x9c28e97e}
},
{ASF_OBJ_DIGITAL_SIGNATURE_OBJECT, "ASF_OBJ_DIGITAL_SIGNATURE_OBJECT",
{0x2211b3fc, 0x11d2bd23, 0xa000b7b4, 0x6efc55c9}
},
{ASF_OBJ_SCRIPT_COMMAND, "ASF_OBJ_SCRIPT_COMMAND",
{0x1efb1a30, 0x11d00b62, 0xa0009ba3, 0xf64803c9}
},
{ASF_OBJ_UNDEFINED, "ASF_OBJ_UNDEFINED",
{0, 0, 0, 0}
}

View file

@ -59,7 +59,11 @@ enum {
ASF_OBJ_INDEX_PLACEHOLDER,
ASF_OBJ_INDEX_PARAMETERS,
ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION,
ASF_OBJ_STREAM_PRIORITIZATION
ASF_OBJ_STREAM_PRIORITIZATION,
ASF_OBJ_CONTENT_ENCRYPTION,
ASF_OBJ_EXT_CONTENT_ENCRYPTION,
ASF_OBJ_DIGITAL_SIGNATURE_OBJECT,
ASF_OBJ_SCRIPT_COMMAND
};
enum {

View file

@ -22,7 +22,8 @@
#endif
#include <gst/gst.h>
#include <gst/riff/riff-media.h>
#include <gst/riff/riff-read.h>
#include "gst/gst-i18n-plugin.h"
#include "gstasfdemux.h"
/* #include "gstasfmux.h" */
@ -30,6 +31,11 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#endif /* ENABLE_NLS */
gst_riff_init ();
if (!gst_element_register (plugin, "asfdemux", GST_RANK_SECONDARY,

View file

@ -25,6 +25,7 @@
#include <gst/gstutils.h>
#include <gst/riff/riff-media.h>
#include "gst/gst-i18n-plugin.h"
#include <string.h>
#include "gstasfdemux.h"
@ -935,7 +936,7 @@ gst_asf_demux_add_audio_stream (GstASFDemux * demux,
gst_asf_demux_setup_pad (demux, src_pad, caps, id, FALSE, tags);
}
static gboolean
static void
gst_asf_demux_add_video_stream (GstASFDemux * demux,
asf_stream_video_format * video, guint16 id,
guint8 ** p_data, guint64 * p_size)
@ -1832,7 +1833,6 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
GstFlowReturn ret;
guint32 obj_id;
guint64 obj_size, obj_data_size;
gint64 processed;
if (!gst_asf_demux_get_object_header (demux, &obj_id, &obj_size, p_data,
p_size)) {
@ -1887,6 +1887,10 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
case ASF_OBJ_LANGUAGE_LIST:
ret = gst_asf_demux_process_language_list (demux, p_data, p_size);
break;
case ASF_OBJ_CONTENT_ENCRYPTION:
case ASF_OBJ_EXT_CONTENT_ENCRYPTION:
case ASF_OBJ_DIGITAL_SIGNATURE_OBJECT:
goto error_encrypted;
case ASF_OBJ_CONCEAL_NONE:
case ASF_OBJ_HEAD2:
case ASF_OBJ_UNDEFINED:
@ -1900,6 +1904,7 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
case ASF_OBJ_INDEX_PARAMETERS:
case ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION:
case ASF_OBJ_STREAM_PRIORITIZATION:
case ASF_OBJ_SCRIPT_COMMAND:
default:
/* Unknown/unhandled object read. Just ignore
* it, people don't like fatal errors much */
@ -1918,6 +1923,14 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
gst_asf_demux_pop_obj (demux);
return ret;
/* ERRORS */
error_encrypted:
{
GST_ELEMENT_ERROR (demux, STREAM, DECODE,
(_("This file is encrypted and cannot be played.")), (NULL));
return GST_FLOW_ERROR;
}
}
static void