[vlc-devel] [PATCH] contrib:ebml: fix reading further than allowed in an EBML master

Steve Lhomme robux4 at videolabs.io
Fri Aug 4 13:19:39 CEST 2017


until this patch is merged upstream

Fixes #17577
---
 contrib/src/ebml/out-of-scope.patch | 13 +++++++++++++
 contrib/src/ebml/rules.mak          |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 contrib/src/ebml/out-of-scope.patch

diff --git a/contrib/src/ebml/out-of-scope.patch b/contrib/src/ebml/out-of-scope.patch
new file mode 100644
index 0000000000..43abb43cdc
--- /dev/null
+++ b/contrib/src/ebml/out-of-scope.patch
@@ -0,0 +1,13 @@
+--- libebml/src/EbmlElement.cpp	2017-08-04 13:03:56.248867500 +0200
++++ libebml/src/EbmlElement.cpp.ooscope	2017-08-04 12:55:38.324923200 +0200
+@@ -405,6 +405,10 @@ EbmlElement * EbmlElement::FindNextEleme
+ 
+     } while (!bFound && MaxDataSize > ReadSize);
+ 
++    if (!bFound)
++        // we reached the maximum we could read without a proper ID
++        return NULL;
++
+     SizeIdx = ReadIndex;
+     ReadIndex -= PossibleID_Length;
+ 
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index d857aac7d6..6b2219bb5f 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -10,6 +10,7 @@ $(TARBALLS)/libebml-$(EBML_VERSION).tar.bz2:
 
 libebml: libebml-$(EBML_VERSION).tar.bz2 .sum-ebml
 	$(UNPACK)
+	$(APPLY) $(SRC)/ebml/out-of-scope.patch
 	$(MOVE)
 
 # libebml requires exceptions
-- 
2.12.1



More information about the vlc-devel mailing list