[vlc-commits] contrib: update libebml to 1.3.6

Steve Lhomme git at videolan.org
Sat Apr 21 11:34:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat Apr 21 11:09:32 2018 +0200| [400c88cbf384f8759dafffbe1a3f6475c8f63d7c] | committer: Steve Lhomme

contrib: update libebml to 1.3.6

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=400c88cbf384f8759dafffbe1a3f6475c8f63d7c
---

 contrib/src/ebml/0001-fix-build-with-gcc-7.patch | 34 ++++++++++++
 contrib/src/ebml/SHA512SUMS                      |  2 +-
 contrib/src/ebml/ebml-end-boundary.patch         | 66 ------------------------
 contrib/src/ebml/ebml-infinite-start.patch       | 11 ----
 contrib/src/ebml/ebml-maxread.patch              | 29 -----------
 contrib/src/ebml/ebml-null-compare.patch         | 11 ----
 contrib/src/ebml/max-size-loop.patch             | 28 ----------
 contrib/src/ebml/rules.mak                       | 11 ++--
 contrib/src/ebml/unknown-check.patch             | 43 ---------------
 9 files changed, 38 insertions(+), 197 deletions(-)

diff --git a/contrib/src/ebml/0001-fix-build-with-gcc-7.patch b/contrib/src/ebml/0001-fix-build-with-gcc-7.patch
new file mode 100644
index 0000000000..fc045bce88
--- /dev/null
+++ b/contrib/src/ebml/0001-fix-build-with-gcc-7.patch
@@ -0,0 +1,34 @@
+From 7038d0048979db61ec75be51e2e62ac34a297176 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Sat, 21 Apr 2018 11:00:03 +0200
+Subject: [PATCH] fix build with gcc 7
+
+---
+ src/platform/win32/WinIOCallback.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/platform/win32/WinIOCallback.cpp b/src/platform/win32/WinIOCallback.cpp
+index b1310ee..f3aeff4 100644
+--- a/src/platform/win32/WinIOCallback.cpp
++++ b/src/platform/win32/WinIOCallback.cpp
+@@ -95,7 +95,7 @@ bool WinIOCallback::open(const char* Path, const open_mode aMode, DWORD dwFlags)
+   }
+ 
+   mFile = CreateFileA(Path, AccessMode, ShareMode, NULL, Disposition, dwFlags, NULL);
+-  if ((mFile == INVALID_HANDLE_VALUE) || ((long)mFile == 0xffffffff)) {
++  if ((mFile == INVALID_HANDLE_VALUE) || (mFile == (HANDLE)0xffffffff)) {
+     //File was not opened
+     char err_msg[256];
+     DWORD error_code = GetLastError();
+@@ -177,7 +177,7 @@ bool WinIOCallback::open(const wchar_t* Path, const open_mode aMode, DWORD dwFla
+       return mOk = false;
+     }
+   }
+-  if ((mFile == INVALID_HANDLE_VALUE) || ((long)mFile == 0xffffffff)) {
++  if ((mFile == INVALID_HANDLE_VALUE) || (mFile == (HANDLE)0xffffffff)) {
+     //File was not opened
+     char err_msg[256];
+     DWORD error_code = GetLastError();
+-- 
+2.8.1.windows.1
+
diff --git a/contrib/src/ebml/SHA512SUMS b/contrib/src/ebml/SHA512SUMS
index 1b384b2511..1769afc1a5 100644
--- a/contrib/src/ebml/SHA512SUMS
+++ b/contrib/src/ebml/SHA512SUMS
@@ -1 +1 @@
-cdf05015724919b19281bf99c562bb7e0bdf16990da274010f664ff316b6ce95ecbeaa1e479f03505281a7f45d5796aee6e7750a9e1c0596b630911d220dca24  libebml-1.3.5.tar.xz
+6a31a56dcde39642848f25353a462f4621d6cfd3bc9ef62add1b00d098c6a80b3c2b50ecf4d6dd50650c609eb39a6150c6d1b69ea3a77a3928bd3300af7dd91f  libebml-1.3.6.tar.xz
diff --git a/contrib/src/ebml/ebml-end-boundary.patch b/contrib/src/ebml/ebml-end-boundary.patch
deleted file mode 100644
index d122ad8df9..0000000000
--- a/contrib/src/ebml/ebml-end-boundary.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 534dfdb995edc18e528de8ce9fa20b3df88426ae Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <slhomme at matroska.org>
-Date: Tue, 23 Jan 2018 15:28:09 +0100
-Subject: [PATCH] Rework the way we look at the end boundary when looking an
- element in a parent
-
-The test `MaxDataSize >= (PossibleID_Length + PossibleSizeLength + SizeFound)`
-is incorrect when there was garbage data skipped inside the PossibleIdNLength
-table.
-
-Now we keep track of how many memmove we had to do to know the real position of
-the PossibleIdNLength data since we started reading. That allows a proper check
-on the end value since that start.
----
- src/EbmlElement.cpp | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp
-index 061074b..871247c 100644
---- libebml-1.3.5/src/EbmlElement.cpp	2018-01-23 15:40:57.156285900 +0100
-+++ libebml-1.3.5/src/EbmlElement.cpp.bound	2018-01-23 15:41:51.547866500 +0100
-@@ -372,11 +372,12 @@ EbmlElement * EbmlElement::FindNextEleme
-   int PossibleSizeLength;
-   uint64 SizeUnknown;
-   int ReadIndex = 0; // trick for the algo, start index at 0
--  uint32 ReadSize = 0;
-+  uint32 ReadSize = 0, IdStart = 0;
-   uint64 SizeFound;
-   int SizeIdx;
-   bool bFound;
-   int UpperLevel_original = UpperLevel;
-+  uint64 ParseStart = DataStream.getFilePointer();
- 
-   do {
-     // read a potential ID
-@@ -402,6 +403,7 @@ EbmlElement * EbmlElement::FindNextEleme
-         // ID not found
-         // shift left the read octets
-         memmove(&PossibleIdNSize[0],&PossibleIdNSize[1], --ReadIndex);
-+        IdStart++;
-       }
- 
-       if (MaxDataSize <= ReadSize)
-@@ -460,10 +462,11 @@ EbmlElement * EbmlElement::FindNextEleme
-           //  0 : child
-           //  1 : same level
-           //  + : further parent
--          if (Result->ValidateSize() && (SizeFound == SizeUnknown || UpperLevel > 0 || MaxDataSize == 0 || MaxDataSize >= (PossibleID_Length + PossibleSizeLength + SizeFound))) {
-+          if (Result->ValidateSize() && (SizeFound == SizeUnknown || UpperLevel > 0 || MaxDataSize == 0 ||
-+                                         MaxDataSize >= (IdStart + PossibleID_Length + _SizeLength + SizeFound))) {
-             if (SizeFound != SizeUnknown || Result->SetSizeInfinite()) {
--              Result->SizePosition = DataStream.getFilePointer() - SizeIdx + EBML_ID_LENGTH(PossibleID);
--              Result->ElementPosition = Result->SizePosition - EBML_ID_LENGTH(PossibleID);
-+              Result->ElementPosition = ParseStart + IdStart;
-+              Result->SizePosition = Result->ElementPosition + PossibleID_Length;
-               // place the file at the beggining of the data
-               DataStream.setFilePointer(Result->SizePosition + _SizeLength);
-               return Result;
-@@ -477,6 +480,7 @@ EbmlElement * EbmlElement::FindNextEleme
-     // recover all the data in the buffer minus one byte
-     ReadIndex = SizeIdx - 1;
-     memmove(&PossibleIdNSize[0], &PossibleIdNSize[1], ReadIndex);
-+    IdStart++;
-     UpperLevel = UpperLevel_original;
-   } while ( MaxDataSize >= ReadSize );
- 
diff --git a/contrib/src/ebml/ebml-infinite-start.patch b/contrib/src/ebml/ebml-infinite-start.patch
deleted file mode 100644
index c843d4c685..0000000000
--- a/contrib/src/ebml/ebml-infinite-start.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ebml/ebml/EbmlMaster.h	2017-08-19 09:04:53.000000000 +0200
-+++ ebml/ebml/EbmlMaster.h.datastart	2018-02-15 14:44:20.473862200 +0100
-@@ -84,7 +84,7 @@ class EBML_DLL_API EbmlMaster : public E
-     }
- 
-     uint64 GetDataStart() const {
--      return GetElementPosition() + EBML_ID_LENGTH((const EbmlId&)*this) + CodedSizeLength(GetSize(), GetSizeLength(), IsFiniteSize());
-+      return GetElementPosition() + EBML_ID_LENGTH((const EbmlId&)*this) + CodedSizeLength(EbmlElement::GetSize(), GetSizeLength(), IsFiniteSize());
-     }
- 
-     /*!
diff --git a/contrib/src/ebml/ebml-maxread.patch b/contrib/src/ebml/ebml-maxread.patch
deleted file mode 100644
index 901e09d860..0000000000
--- a/contrib/src/ebml/ebml-maxread.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- ebml/src/EbmlElement.cpp	2017-11-27 09:12:56.891612600 +0100
-+++ ebml/src/EbmlElement.cpp.maxread	2017-11-27 09:29:17.335279000 +0100
-@@ -404,12 +404,14 @@ EbmlElement * EbmlElement::FindNextEleme
-         memmove(&PossibleIdNSize[0],&PossibleIdNSize[1], --ReadIndex);
-       }
- 
-+      if (MaxDataSize <= ReadSize)
-+          break;
-       if (DataStream.read(&PossibleIdNSize[ReadIndex++], 1) == 0) {
-         return NULL; // no more data ?
-       }
-       ReadSize++;
- 
--    } while (!bFound && MaxDataSize > ReadSize);
-+    } while (!bFound);
- 
-     if (!bFound)
-       // we reached the maximum we could read without a proper ID
-@@ -432,6 +434,10 @@ EbmlElement * EbmlElement::FindNextEleme
-         bFound = false;
-         break;
-       }
-+      if (MaxDataSize <= ReadSize) {
-+        bFound = false;
-+        break;
-+      }
-       if( DataStream.read( &PossibleIdNSize[SizeIdx++], 1 ) == 0 ) {
-         return NULL; // no more data ?
-       }
diff --git a/contrib/src/ebml/ebml-null-compare.patch b/contrib/src/ebml/ebml-null-compare.patch
deleted file mode 100644
index a82a3c63f3..0000000000
--- a/contrib/src/ebml/ebml-null-compare.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ebml/src/EbmlBinary.cpp	2018-02-09 13:51:37.752623200 +0100
-+++ ebml/src/EbmlBinary.cpp.null_cmp	2018-02-09 13:50:41.409429100 +0100
-@@ -100,7 +100,7 @@ filepos_t EbmlBinary::ReadData(IOCallbac
- 
- bool EbmlBinary::operator==(const EbmlBinary & ElementToCompare) const
- {
--  return ((GetSize() == ElementToCompare.GetSize()) && !memcmp(Data, ElementToCompare.Data, GetSize()));
-+  return ((GetSize() == ElementToCompare.GetSize()) && (GetSize() == 0 || !memcmp(Data, ElementToCompare.Data, GetSize())));
- }
- 
- END_LIBEBML_NAMESPACE
diff --git a/contrib/src/ebml/max-size-loop.patch b/contrib/src/ebml/max-size-loop.patch
deleted file mode 100644
index d3da47a5eb..0000000000
--- a/contrib/src/ebml/max-size-loop.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From b66ca475be967547af9a3784e720fbbacd381be6 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <slhomme at matroska.org>
-Date: Mon, 22 Jan 2018 15:42:53 +0100
-Subject: [PATCH] Exit the max size loop when there's nothing left possible to
- find
-
-DataStream.getFilePointer() is not correct in this context. It might force to
-exit too early.
----
- src/EbmlElement.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp
-index ac0be41..061074b 100644
---- a/src/EbmlElement.cpp
-+++ b/src/EbmlElement.cpp
-@@ -478,7 +478,7 @@ EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSe
-     ReadIndex = SizeIdx - 1;
-     memmove(&PossibleIdNSize[0], &PossibleIdNSize[1], ReadIndex);
-     UpperLevel = UpperLevel_original;
--  } while ( MaxDataSize > DataStream.getFilePointer() - SizeIdx + PossibleID_Length );
-+  } while ( MaxDataSize >= ReadSize );
- 
-   return NULL;
- }
--- 
-2.10.1.windows.1
-
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index c1c8c59653..146fd6dced 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -1,6 +1,6 @@
 # ebml
 
-EBML_VERSION := 1.3.5
+EBML_VERSION := 1.3.6
 EBML_URL := http://dl.matroska.org/downloads/libebml/libebml-$(EBML_VERSION).tar.xz
 
 ifeq ($(call need_pkg,"libebml"),)
@@ -14,12 +14,7 @@ $(TARBALLS)/libebml-$(EBML_VERSION).tar.xz:
 
 ebml: libebml-$(EBML_VERSION).tar.xz .sum-ebml
 	$(UNPACK)
-	$(APPLY) $(SRC)/ebml/ebml-maxread.patch
-	$(APPLY) $(SRC)/ebml/unknown-check.patch
-	$(APPLY) $(SRC)/ebml/max-size-loop.patch
-	$(APPLY) $(SRC)/ebml/ebml-end-boundary.patch
-	$(APPLY) $(SRC)/ebml/ebml-null-compare.patch
-	$(APPLY) $(SRC)/ebml/ebml-infinite-start.patch
+	$(APPLY) $(SRC)/ebml/0001-fix-build-with-gcc-7.patch
 	$(MOVE)
 
 # libebml requires exceptions
@@ -29,6 +24,6 @@ EBML_EXTRA_FLAGS += CPPFLAGS=""
 endif
 
 .ebml: ebml
-	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(EBML_EXTRA_FLAGS)
+	cd $< && $(HOSTVARS) $(CMAKE) -DBUILD_SHARED_LIBS=OFF
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/ebml/unknown-check.patch b/contrib/src/ebml/unknown-check.patch
deleted file mode 100644
index 895a4d664e..0000000000
--- a/contrib/src/ebml/unknown-check.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From ff0dc3cc21494578ce731f5d7dcde5fdec23d40f Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <slhomme at matroska.org>
-Date: Wed, 6 Dec 2017 09:32:13 +0100
-Subject: [PATCH] Do not output an element with size Unknown if it's not
- allowed
-
-Similar to what is done in FindNextID().
-
-SetSizeInfinite() doesn't actually set anything. SetSizeIsFinite() is the one
-that actually sets it and it is an internal API.
----
- src/EbmlElement.cpp | 14 ++++++--------
- 1 file changed, 6 insertions(+), 8 deletions(-)
-
-diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp
-index ae4441e..ac0be41 100644
---- a/src/EbmlElement.cpp
-+++ b/src/EbmlElement.cpp
-@@ -461,15 +461,13 @@ EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSe
-           //  1 : same level
-           //  + : further parent
-           if (Result->ValidateSize() && (SizeFound == SizeUnknown || UpperLevel > 0 || MaxDataSize == 0 || MaxDataSize >= (PossibleID_Length + PossibleSizeLength + SizeFound))) {
--            if (SizeFound == SizeUnknown) {
--              Result->SetSizeInfinite();
-+            if (SizeFound != SizeUnknown || Result->SetSizeInfinite()) {
-+              Result->SizePosition = DataStream.getFilePointer() - SizeIdx + EBML_ID_LENGTH(PossibleID);
-+              Result->ElementPosition = Result->SizePosition - EBML_ID_LENGTH(PossibleID);
-+              // place the file at the beggining of the data
-+              DataStream.setFilePointer(Result->SizePosition + _SizeLength);
-+              return Result;
-             }
--
--            Result->SizePosition = DataStream.getFilePointer() - SizeIdx + EBML_ID_LENGTH(PossibleID);
--            Result->ElementPosition = Result->SizePosition - EBML_ID_LENGTH(PossibleID);
--            // place the file at the beggining of the data
--            DataStream.setFilePointer(Result->SizePosition + _SizeLength);
--            return Result;
-           }
-         }
-         delete Result;
--- 
-2.10.1.windows.1
-



More information about the vlc-commits mailing list