Bugfixes for the matroska demuxer.

from Brad (maintainer)
This commit is contained in:
dcoppa 2011-10-30 21:20:19 +00:00
parent dbd89c9180
commit 05c25eb0de
3 changed files with 56 additions and 4 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.82 2011/10/13 07:27:00 dcoppa Exp $
# $OpenBSD: Makefile,v 1.83 2011/10/30 21:20:19 dcoppa Exp $
SHARED_ONLY= Yes
COMMENT= multimedia decoding library
DISTNAME= xine-lib-1.1.19
REVISION= 12
REVISION= 13
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xine/}
EXTRACT_SUFX= .tar.bz2

View File

@ -1,10 +1,11 @@
$OpenBSD: patch-src_demuxers_demux_matroska_c,v 1.6 2011/10/13 07:27:00 dcoppa Exp $
$OpenBSD: patch-src_demuxers_demux_matroska_c,v 1.7 2011/10/30 21:20:21 dcoppa Exp $
- Header stripping support.
- VP8 support.
- Fix NULL dereferences and skipping of unknown elements.
--- src/demuxers/demux_matroska.c.orig Mon Jul 19 14:01:43 2010
+++ src/demuxers/demux_matroska.c Tue Oct 11 02:43:22 2011
+++ src/demuxers/demux_matroska.c Fri Oct 28 00:49:57 2011
@@ -304,8 +304,12 @@ static int parse_content_compression (demux_matroska_t
}
break;
@ -133,3 +134,21 @@ $OpenBSD: patch-src_demuxers_demux_matroska_c,v 1.6 2011/10/13 07:27:00 dcoppa E
return 0;
has_block = 1;
@@ -2993,7 +3030,7 @@ static demux_plugin_t *open_plugin (demux_class_t *cla
if (ebml->max_size_len > 8)
goto error;
/* handle both Matroska and WebM here; we don't (presently) differentiate */
- if (strcmp(ebml->doctype, "matroska") && strcmp(ebml->doctype, "webm"))
+ if (!ebml->doctype || (strcmp(ebml->doctype, "matroska") && strcmp(ebml->doctype, "webm")))
goto error;
this->event_queue = xine_event_new_queue(this->stream);
@@ -3003,7 +3040,7 @@ static demux_plugin_t *open_plugin (demux_class_t *cla
error:
dispose_ebml_parser(ebml);
- if (NULL != this) {
+ if (this != NULL && this->event_queue != NULL) {
xine_event_dispose_queue(this->event_queue);
free(this);
}

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-src_demuxers_ebml_c,v 1.3 2011/10/30 21:20:21 dcoppa Exp $
Fix NULL dereferences and skipping of unknown elements.
--- src/demuxers/ebml.c.orig Fri Oct 28 00:50:36 2011
+++ src/demuxers/ebml.c Fri Oct 28 00:52:43 2011
@@ -211,14 +211,13 @@ int ebml_skip(ebml_parser_t *ebml, ebml_elem_t *elem)
int ebml_read_elem_head(ebml_parser_t *ebml, ebml_elem_t *elem) {
- if (!ebml_read_elem_id(ebml, &elem->id))
- return 0;
+ int ret_id = ebml_read_elem_id(ebml, &elem->id);
- if (!ebml_read_elem_len(ebml, &elem->len))
- return 0;
+ int ret_len = ebml_read_elem_len(ebml, &elem->len);
elem->start = ebml->input->get_current_pos(ebml->input);
- return 1;
+
+ return (ret_id && ret_len);
}
@@ -473,6 +472,7 @@ int ebml_check_header(ebml_parser_t *ebml) {
default:
xprintf(ebml->xine, XINE_VERBOSITY_LOG,
"ebml: Unknown data type 0x%x in EBML header (ignored)\n", elem.id);
+ ebml_skip(ebml, &elem);
}
next_level = ebml_get_next_level(ebml, &elem);
}