[vlc-devel] [PATCH] contrib: fix eof not detected when looking for an ID size
Steve Lhomme
robux4 at gmail.com
Fri Aug 21 13:49:29 CEST 2015
do use the data in memory that wasn't actually read
---
contrib/src/ebml/eof.patch | 15 +++++++++++++++
contrib/src/ebml/rules.mak | 1 +
2 files changed, 16 insertions(+)
create mode 100644 contrib/src/ebml/eof.patch
diff --git a/contrib/src/ebml/eof.patch b/contrib/src/ebml/eof.patch
new file mode 100644
index 0000000..72026b0
--- /dev/null
+++ b/contrib/src/ebml/eof.patch
@@ -0,0 +1,15 @@
+--- libebml/src/EbmlElement.cpp 2015-08-21 12:58:03.738589700 +0200
++++ libebml/src/EbmlElement.cpp.eof 2015-08-21 12:55:18.972736500 +0200
+@@ -417,7 +417,10 @@
+ bFound = false;
+ break;
+ }
+- ReadSize += DataStream.read(&PossibleIdNSize[SizeIdx++], 1);
++ if( DataStream.read( &PossibleIdNSize[SizeIdx++], 1 ) == 0 ) {
++ return NULL; // no more data ?
++ }
++ ReadSize++;
+ PossibleSizeLength++;
+ }
+
+
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index f8ff559..8b4a914 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -11,6 +11,7 @@ $(TARBALLS)/libebml-$(EBML_VERSION).tar.bz2:
libebml: libebml-$(EBML_VERSION).tar.bz2 .sum-ebml
$(UNPACK)
+ $(APPLY) $(SRC)/ebml/eof.patch
ifdef HAVE_WINRT
$(APPLY) $(SRC)/ebml/winstore.patch
endif
--
2.5.0
More information about the vlc-devel
mailing list