[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: ebml: update to 1.4.6

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jul 23 06:25:09 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
17f5cc89 by Steve Lhomme at 2026-07-23T05:51:52+00:00
contrib: ebml: update to 1.4.6

* Set EbmlHead as not allowed to be infinite (as per RFC 8794)
* Fix leak on upper element found inside the last element
* EbmlString::ReadFully: use automatic memory management/fewer allocations
* EbmlUnicodeString: use std::string when reading instead of manual memory management
* IOCallback: avoid reading more than 2^32 at once
* Fix some includes that are not implicit in modern compilers
* Download utfcpp automatically
* Show a summary of build configuration when configuring CMake
* Add a DEV_MODE CMake option to check more compiler errors (default off)

- - - - -
08510c27 by Steve Lhomme at 2026-07-23T05:51:52+00:00
contrib: matroska: update to 1.7.2

* Do not allow infinite sizes on all Master elements except Segment+Cluster
  (as per RFC 9559).
* Only allow `KaxSeekId` of 4 bytes length (as per RFC 9559).
* KaxBlock: release read buffers on `EndOfStream` error.
* Catch some allocation failures internally.
* Deprecate `KaxTrackMinCache`/`KaxTrackMaxCache` elements (as per RFC 9559).
* Deprecate `KaxTrackOverlay` element (as per RFC 9559).
* Fix `MATROSKA_VIDEO_FIELDORDER_TOPFIELDSWAPPED`/
  `MATROSKA_VIDEO_FIELDORDER_BOTTOMFIELDSWAPPED` values.
* Add missing `MatroskaChapProcessCodecID` enum.
* [API break] remove `MatroskaChapterTranslateCodec`/`MatroskaTrackTranslateCodec`.
* KaxSemantic: update enum comments to match RFC 9559.
* Add `MATROSKA_CHAPTERSKIPTYPE_INTERMISSION` to `MatroskaChapterSkipType`.
* Fix some includes that are not implicit in modern compilers.
* Show a summary of build configuration when configuring CMake.
* Add a DEV_MODE CMake option to check more compiler errors (default off).
* Add a BUILD_EXAMPLES CMake option (default off).

- - - - -


19 changed files:

- − contrib/src/ebml/0001-EbmlHead-do-not-allow-to-have-an-infinite-unknown-si.patch
- − contrib/src/ebml/0001-EbmlMaster-fix-leak-on-upper-element-found-inside-th.patch
- − contrib/src/ebml/0001-EbmlMaster-fix-leak-when-reading-upper-level-element.patch
- − contrib/src/ebml/0001-EbmlString-ReadFully-use-automatic-memory-management.patch
- − contrib/src/ebml/0001-IOCallback-avoid-reading-more-than-2-32-at-once.patch
- − contrib/src/ebml/0001-include-iterator-for-std-back_inserter.patch
- − contrib/src/ebml/0002-EbmlMaster-exit-reading-loop-if-upper-element-found-.patch
- − contrib/src/ebml/0002-EbmlUnicodeString-use-std-string-when-reading-instea.patch
- − contrib/src/ebml/0002-include-new-for-std-nothrow.patch
- contrib/src/ebml/SHA512SUMS
- contrib/src/ebml/rules.mak
- − contrib/src/matroska/0001-KaxBlock-expand-FrameNum-after-reading.patch
- − contrib/src/matroska/0001-KaxBlock-release-read-buffers-on-EndOfStream-error.patch
- − contrib/src/matroska/0001-KaxBlock-rework-EBML-lacing-sizes-in-SCOPE_PARTIAL_D.patch
- − contrib/src/matroska/0001-KaxDefines-do-not-allow-infinite-sizes-on-all-Master.patch
- − contrib/src/matroska/0002-KaxBlock-throw-when-the-EBML-length-difference-gives.patch
- − contrib/src/matroska/0003-KaxBlock-fix-reading-EBML-lacing-with-just-one-frame.patch
- contrib/src/matroska/SHA512SUMS
- contrib/src/matroska/rules.mak


Changes:

=====================================
contrib/src/ebml/0001-EbmlHead-do-not-allow-to-have-an-infinite-unknown-si.patch deleted
=====================================
@@ -1,28 +0,0 @@
-From 4ad8d9335f593d767f319b61ba5dc531fb2c3e52 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 25 Jul 2025 14:37:18 +0200
-Subject: [PATCH] EbmlHead: do not allow to have an infinite/unknown size
-
-It does not have [^1]  unknownsizeallowed set to true (default to false)
-
-[^1]: https://www.rfc-editor.org/rfc/rfc8794.html#section-11.2.1
----
- ebml/EbmlHead.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/ebml/EbmlHead.h b/ebml/EbmlHead.h
-index b575b79..9768b5f 100644
---- a/ebml/EbmlHead.h
-+++ b/ebml/EbmlHead.h
-@@ -46,6 +46,8 @@ DECLARE_EBML_MASTER(EbmlHead)
-     EbmlHead(const EbmlHead & ElementToClone)  = default;
- 
-         EBML_CONCRETE_CLASS(EbmlHead)
-+
-+    bool SetSizeInfinite(bool finite = true) override { return !finite; }
- };
- 
- } // namespace libebml
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/ebml/0001-EbmlMaster-fix-leak-on-upper-element-found-inside-th.patch deleted
=====================================
@@ -1,51 +0,0 @@
-From 370bcc4fb22af9d07bca911457e5fe20119e3bd2 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Tue, 2 Jun 2026 11:37:54 +0200
-Subject: [PATCH] EbmlMaster: fix leak on upper element found inside the last
- element
-
-We found an upper element and there is not data to read after the current
-element within its parent. That upper element is misplaced and should be
-discarded.
-The last element is truncated and doesn't contain the rest of its data.
----
- src/EbmlMaster.cpp | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp
-index 4851618..d91ab06 100644
---- a/src/EbmlMaster.cpp
-+++ b/src/EbmlMaster.cpp
-@@ -445,8 +445,13 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
- 
-           if (UpperEltFound) {
-             --UpperEltFound;
--            if (UpperEltFound > 0 || MaxSizeToRead <= 0)
-+            if (UpperEltFound > 0)
-               goto processCrc;
-+            if (MaxSizeToRead <= 0) {
-+              delete FoundElt;
-+              FoundElt = nullptr;
-+              goto processCrc;
-+            }
-             ElementLevelA = FoundElt;
-           }
- 
-@@ -456,8 +461,13 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
- 
-       if (UpperEltFound > 0) {
-         UpperEltFound--;
--        if (UpperEltFound > 0 || MaxSizeToRead <= 0)
-+        if (UpperEltFound > 0)
-+          goto processCrc;
-+        if (MaxSizeToRead <= 0) {
-+          delete FoundElt;
-+          FoundElt = nullptr;
-           goto processCrc;
-+        }
-         ElementLevelA = FoundElt;
-         if (IsFiniteSize() && ElementLevelA->IsFiniteSize()) {
-           if (ElementLevelA->GetEndPosition() > GetEndPosition()) {
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/ebml/0001-EbmlMaster-fix-leak-when-reading-upper-level-element.patch deleted
=====================================
@@ -1,36 +0,0 @@
-From fd2b70256e8e4b35a62a90bfae2ca48e0996d5a2 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 25 Jul 2025 14:37:18 +0200
-Subject: [PATCH 1/2] EbmlMaster: fix leak when reading upper level elements
-
-When an element from an upper level is found we go up the caller chain,
-passing the found element but it was not actually used (added to a list or freed).
-
-This patch allows setting that element as the ElementLevelA found in the loop.
-We skip the call the inDataStream.FindNextElement() to find it.
-
-The new MaxSizeToRead is the size to read in the next inDataStream.FindNextElement() call.
-
-The old MaxSizeToRead <= 0 code seems bogus as it would exit the loop
-to find elements for that EbmlMaster even though there might still be elements to read.
----
- src/EbmlMaster.cpp | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp
-index faadfd0..e8a43cc 100644
---- a/src/EbmlMaster.cpp
-+++ b/src/EbmlMaster.cpp
-@@ -453,6 +453,9 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
-         if (UpperEltFound > 0 || MaxSizeToRead == 0)
-           goto processCrc;
-         ElementLevelA = FoundElt;
-+        if (IsFiniteSize() && ElementLevelA->IsFiniteSize()) {
-+          MaxSizeToRead = GetEndPosition() - ElementLevelA->GetEndPosition(); // even if it's the default value
-+        }
-         continue;
-       }
- 
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/ebml/0001-EbmlString-ReadFully-use-automatic-memory-management.patch deleted
=====================================
@@ -1,54 +0,0 @@
-From bd77aaa19f0c658254f4e2a0c069a1bfcf0dbea2 Mon Sep 17 00:00:00 2001
-From: Moritz Bunkus <mo at bunkus.online>
-Date: Sat, 23 Dec 2023 09:33:04 +0100
-Subject: [PATCH 1/2] EbmlString::ReadFully: use automatic memory
- management/fewer allocations
-
-(cherry picked from commit ae9bb2580c3e0a79496e72f79185256670abeb95)
----
- src/EbmlString.cpp | 26 +++++++++++---------------
- 1 file changed, 11 insertions(+), 15 deletions(-)
-
-diff --git a/src/EbmlString.cpp b/src/EbmlString.cpp
-index e1f4597..66b3338 100644
---- a/src/EbmlString.cpp
-+++ b/src/EbmlString.cpp
-@@ -142,24 +142,20 @@ filepos_t EbmlString::ReadData(IOCallback & input, ScopeMode ReadFully)
-     return GetSize();
- 
-   if (GetSize() == 0) {
--    Value = "";
--    SetValueIsSet();
-+    Value.clear();
-+
-   } else {
--    auto Buffer = (GetSize() + 1 < std::numeric_limits<std::size_t>::max()) ? new (std::nothrow) char[GetSize() + 1] : nullptr;
--    if (Buffer == nullptr) {
--      // unable to store the data, skip it
--      input.setFilePointer(GetSize(), seek_current);
--    } else {
--      input.readFully(Buffer, GetSize());
--      if (Buffer[GetSize()-1] != '\0') {
--        Buffer[GetSize()] = '\0';
--      }
--      Value = Buffer;
--      delete [] Buffer;
--      SetValueIsSet();
--    }
-+    Value.resize(GetSize());
-+    std::memset(&Value[0], 0, GetSize());
-+    input.readFully(&Value[0], GetSize());
-+
-+    auto PosNull = Value.find('\0');
-+    if (PosNull != std::string::npos)
-+      Value.resize(PosNull);
-   }
- 
-+  SetValueIsSet();
-+
-   return GetSize();
- }
- 
--- 
-2.45.1.windows.1
-


=====================================
contrib/src/ebml/0001-IOCallback-avoid-reading-more-than-2-32-at-once.patch deleted
=====================================
@@ -1,51 +0,0 @@
-From 1a8c6d1e2518fe19d1d1d206b6df03470abb8e09 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <slhomme at matroska.org>
-Date: Sun, 2 Oct 2022 09:24:27 +0200
-Subject: [PATCH] IOCallback: avoid reading more than 2^32 at once
-
-In practice it should never happen as 2^32+1 buffers are not possible on any
-known platform. But better safe than sorry. Or memory mapped files could reach
-this code ?
-
-(cherry picked from commit 40b4797829f6a35c1ea0a160ba7feed7443acb7d)
----
- src/IOCallback.cpp | 16 ++++++++++++----
- 1 file changed, 12 insertions(+), 4 deletions(-)
-
-diff --git a/src/IOCallback.cpp b/src/IOCallback.cpp
-index 13ed635..4fbaeee 100644
---- a/src/IOCallback.cpp
-+++ b/src/IOCallback.cpp
-@@ -33,6 +33,7 @@
-   \author Moritz Bunkus <moritz @ bunkus.org>
- */
- 
-+#include <limits>
- #include <sstream>
- #include <stdexcept>
- 
-@@ -64,10 +65,17 @@ void IOCallback::readFully(void*Buffer,size_t Size)
-   if(Buffer == nullptr)
-     throw;
- 
--  if(read(Buffer,Size) != Size) {
--    stringstream Msg;
--    Msg<<"EOF in readFully("<<Buffer<<","<<Size<<")";
--    throw runtime_error(Msg.str());
-+  char *readBuf = static_cast<char *>(Buffer);
-+  uint32_t readSize = static_cast<uint32_t>(std::min<size_t>(std::numeric_limits<uint32>::max(), Size));
-+  while (readSize != 0) {
-+    if(read(readBuf,readSize) != readSize) {
-+      stringstream Msg;
-+      Msg<<"EOF in readFully("<<Buffer<<","<<Size<<")";
-+      throw runtime_error(Msg.str());
-+    }
-+    Size -= readSize;
-+    readBuf += readSize;
-+    readSize = static_cast<uint32_t>(std::min<size_t>(std::numeric_limits<uint32>::max(), Size));
-   }
- }
- 
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/ebml/0001-include-iterator-for-std-back_inserter.patch deleted
=====================================
@@ -1,37 +0,0 @@
-From 3a2ab2c706b31fea4f92cd362c93e2aa7875ccf8 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Sat, 2 May 2026 10:19:11 +0200
-Subject: [PATCH 1/2] include iterator for std::back_inserter
-
----
- src/EbmlMaster.cpp        | 1 +
- src/EbmlUnicodeString.cpp | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp
-index 465560f..1340931 100644
---- a/src/EbmlMaster.cpp
-+++ b/src/EbmlMaster.cpp
-@@ -36,6 +36,7 @@
- 
- #include <cassert>
- #include <algorithm>
-+#include <iterator>
- 
- #include "ebml/EbmlMaster.h"
- #include "ebml/EbmlStream.h"
-diff --git a/src/EbmlUnicodeString.cpp b/src/EbmlUnicodeString.cpp
-index 570af17..481e358 100644
---- a/src/EbmlUnicodeString.cpp
-+++ b/src/EbmlUnicodeString.cpp
-@@ -36,6 +36,7 @@
- */
- 
- #include <cassert>
-+#include <iterator>
- #include <limits>
- 
- #include "ebml/EbmlUnicodeString.h"
--- 
-2.43.0
-


=====================================
contrib/src/ebml/0002-EbmlMaster-exit-reading-loop-if-upper-element-found-.patch deleted
=====================================
@@ -1,29 +0,0 @@
-From 50fba837fa4ebdd9b3c46f71a952873ae569cd48 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 30 Apr 2026 16:28:00 +0200
-Subject: [PATCH 2/2] EbmlMaster: exit reading loop if upper element found ends
- after its parent
-
-It could be a file with missing data in the middle.
-And we shouldn't use a MaxSizeToRead that would be negative.
----
- src/EbmlMaster.cpp | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp
-index e8a43cc..6f03432 100644
---- a/src/EbmlMaster.cpp
-+++ b/src/EbmlMaster.cpp
-@@ -454,6 +454,9 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
-           goto processCrc;
-         ElementLevelA = FoundElt;
-         if (IsFiniteSize() && ElementLevelA->IsFiniteSize()) {
-+          if (ElementLevelA->GetEndPosition() > GetEndPosition()) {
-+            goto processCrc; // found an upper element that ends after this, we were truncated
-+          }
-           MaxSizeToRead = GetEndPosition() - ElementLevelA->GetEndPosition(); // even if it's the default value
-         }
-         continue;
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/ebml/0002-EbmlUnicodeString-use-std-string-when-reading-instea.patch deleted
=====================================
@@ -1,50 +0,0 @@
-From 12c0cebbbda310420a935c021014bffc2b179102 Mon Sep 17 00:00:00 2001
-From: Moritz Bunkus <mo at bunkus.online>
-Date: Fri, 22 Dec 2023 17:50:15 +0100
-Subject: [PATCH 2/2] EbmlUnicodeString: use std::string when reading instead
- of manual memory management
-
-(cherry picked from commit 6b83a0f6f6d1ae7fa14a4f96e70914c1a9686ed4)
----
- src/EbmlUnicodeString.cpp | 22 +++++++---------------
- 1 file changed, 7 insertions(+), 15 deletions(-)
-
-diff --git a/src/EbmlUnicodeString.cpp b/src/EbmlUnicodeString.cpp
-index 56f74ce..570af17 100644
---- a/src/EbmlUnicodeString.cpp
-+++ b/src/EbmlUnicodeString.cpp
-@@ -308,24 +308,16 @@ filepos_t EbmlUnicodeString::ReadData(IOCallback & input, ScopeMode ReadFully)
- 
-   if (GetSize() == 0) {
-     Value = static_cast<UTFstring::value_type>(0);
--    SetValueIsSet();
-+
-   } else {
--    auto Buffer = (GetSize() + 1 < std::numeric_limits<std::size_t>::max()) ? new (std::nothrow) char[GetSize()+1] : nullptr;
--    if (Buffer == nullptr) {
--      // impossible to read, skip it
--      input.setFilePointer(GetSize(), seek_current);
--    } else {
--      input.readFully(Buffer, GetSize());
--      if (Buffer[GetSize()-1] != 0) {
--        Buffer[GetSize()] = 0;
--      }
--
--      Value.SetUTF8(Buffer); // implicit conversion to std::string
--      delete [] Buffer;
--      SetValueIsSet();
--    }
-+    std::string Buffer(static_cast<std::string::size_type>(GetSize()), static_cast<char>(0));
-+    input.readFully(&Buffer[0], GetSize());
-+
-+    Value.SetUTF8(Buffer.c_str()); // Let conversion to std::string cut off at the first 0
-   }
- 
-+  SetValueIsSet();
-+
-   return GetSize();
- }
- 
--- 
-2.45.1.windows.1
-


=====================================
contrib/src/ebml/0002-include-new-for-std-nothrow.patch deleted
=====================================
@@ -1,64 +0,0 @@
-From 9b4f8cd0400dff2084c9a54d6d521efb92622960 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Sat, 2 May 2026 10:20:51 +0200
-Subject: [PATCH 2/2] include new for std::nothrow
-
----
- src/EbmlCrc32.cpp         | 2 ++
- src/EbmlElement.cpp       | 1 +
- src/EbmlString.cpp        | 1 +
- src/EbmlUnicodeString.cpp | 1 +
- 4 files changed, 5 insertions(+)
-
-diff --git a/src/EbmlCrc32.cpp b/src/EbmlCrc32.cpp
-index 45765bf..65ee319 100644
---- a/src/EbmlCrc32.cpp
-+++ b/src/EbmlCrc32.cpp
-@@ -38,6 +38,8 @@
- #include "ebml/EbmlContexts.h"
- #include "ebml/MemIOCallback.h"
- 
-+#include <new>
-+
- #ifdef WORDS_BIGENDIAN
- static constexpr uint32_t CRC32_INDEX(uint32_t c) { return c >> 24; }
- static constexpr uint32_t CRC32_SHIFTED(uint32_t c) { return c << 8; }
-diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp
-index 6f974c5..2bbf653 100644
---- a/src/EbmlElement.cpp
-+++ b/src/EbmlElement.cpp
-@@ -36,6 +36,7 @@
- #include <cstdlib>
- #include <cstring>
- #include <iostream>
-+#include <new>
- #include <stdexcept>
- #include <sstream>
- 
-diff --git a/src/EbmlString.cpp b/src/EbmlString.cpp
-index 66b3338..fbfdf96 100644
---- a/src/EbmlString.cpp
-+++ b/src/EbmlString.cpp
-@@ -34,6 +34,7 @@
-   \author Steve Lhomme     <robux4 @ users.sf.net>
- */
- #include <cassert>
-+#include <new>
- #include <limits>
- 
- #include "ebml/EbmlString.h"
-diff --git a/src/EbmlUnicodeString.cpp b/src/EbmlUnicodeString.cpp
-index 481e358..dd77200 100644
---- a/src/EbmlUnicodeString.cpp
-+++ b/src/EbmlUnicodeString.cpp
-@@ -38,6 +38,7 @@
- #include <cassert>
- #include <iterator>
- #include <limits>
-+#include <new>
- 
- #include "ebml/EbmlUnicodeString.h"
- 
--- 
-2.43.0
-


=====================================
contrib/src/ebml/SHA512SUMS
=====================================
@@ -1 +1 @@
-6ee2afd538de8b028a1acd4a0f00a8aa230deac297573d868683e96f22fa4953858d3a1d8ab414ac27757f35699e6149f0aaef6eb4d235baa79226d8f36ccb5c  libebml-1.4.5.tar.xz
+86b469a1c1352e9ea6f581267ab8fc357575f2e410a3a732b12203575744667b152c135cf314978500d6a19fac4ef4015b89fdcfcca43f5bfc49f63e27ecbce2  libebml-1.4.6.tar.xz


=====================================
contrib/src/ebml/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # ebml
 
-EBML_VERSION := 1.4.5
+EBML_VERSION := 1.4.6
 EBML_URL := https://dl.matroska.org/downloads/libebml/libebml-$(EBML_VERSION).tar.xz
 
 ifeq ($(call need_pkg,"libebml >= 1.3.8"),)
@@ -14,20 +14,11 @@ $(TARBALLS)/libebml-$(EBML_VERSION).tar.xz:
 
 ebml: libebml-$(EBML_VERSION).tar.xz .sum-ebml
 	$(UNPACK)
-	$(APPLY) $(SRC)/ebml/0001-IOCallback-avoid-reading-more-than-2-32-at-once.patch
-	$(APPLY) $(SRC)/ebml/0001-EbmlString-ReadFully-use-automatic-memory-management.patch
-	$(APPLY) $(SRC)/ebml/0002-EbmlUnicodeString-use-std-string-when-reading-instea.patch
-	$(APPLY) $(SRC)/ebml/0001-EbmlMaster-fix-leak-when-reading-upper-level-element.patch
-	$(APPLY) $(SRC)/ebml/0002-EbmlMaster-exit-reading-loop-if-upper-element-found-.patch
-	$(APPLY) $(SRC)/ebml/0001-EbmlHead-do-not-allow-to-have-an-infinite-unknown-si.patch
-	$(APPLY) $(SRC)/ebml/0001-include-iterator-for-std-back_inserter.patch
-	$(APPLY) $(SRC)/ebml/0002-include-new-for-std-nothrow.patch
-	$(APPLY) $(SRC)/ebml/0001-EbmlMaster-fix-leak-on-upper-element-found-inside-th.patch
 	$(MOVE)
 
 .ebml: ebml toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_CMAKE) $(CMAKE) -DCMAKE_POLICY_VERSION_MINIMUM=3.5
+	$(HOSTVARS_CMAKE) $(CMAKE)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@


=====================================
contrib/src/matroska/0001-KaxBlock-expand-FrameNum-after-reading.patch deleted
=====================================
@@ -1,41 +0,0 @@
-From fd4cfd9f04fa6fba4f1ac9ecc9b68930e40056ec Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Tue, 12 May 2026 07:59:51 +0200
-Subject: [PATCH] KaxBlock: expand FrameNum after reading
-
-It's read as a uint8_t. Adding 1 to 255 would end up being 0.
----
- src/KaxBlock.cpp | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
-index 7bcc879..b3f2a84 100644
---- a/src/KaxBlock.cpp
-+++ b/src/KaxBlock.cpp
-@@ -496,9 +496,9 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-       } else {
-         // read the number of frames in the lace
-         uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame
--        const uint8 FrameNum = Mem.GetUInt8(); // number of frames in the lace - 1
-+        const unsigned FrameNum = Mem.GetUInt8(); // number of frames in the lace - 1
-         // read the list of frame sizes
--        uint8 Index;
-+        unsigned Index;
-         int32 FrameSize;
-         uint32 SizeRead;
-         uint64 SizeUnknown;
-@@ -628,9 +628,9 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-         // read the number of frames in the lace
-         const uint32 TotalLacedSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame
-         uint32 LastBufferSize = TotalLacedSize;
--        const uint8 FrameNum = _TempHead[0]; // number of frames in the lace - 1
-+        const unsigned FrameNum = _TempHead[0]; // number of frames in the lace - 1
-         // read the list of frame sizes
--        uint8 Index;
-+        unsigned Index;
-         uint32 FrameSize;
-         uint32 SizeRead;
-         uint64 SizeUnknown;
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/matroska/0001-KaxBlock-release-read-buffers-on-EndOfStream-error.patch deleted
=====================================
@@ -1,24 +0,0 @@
-From b0220cd5dde77970452a74dd9046b17617d3c7b8 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Wed, 22 Apr 2026 07:50:09 +0200
-Subject: [PATCH] KaxBlock: release read buffers on EndOfStream error
-
----
- src/KaxBlock.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
-index 1fae7e4..1522799 100644
---- a/src/KaxBlock.cpp
-+++ b/src/KaxBlock.cpp
-@@ -708,6 +708,7 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-   } catch (SafeReadIOCallback::EndOfStreamX &) {
-     SetValueIsSet(false);
- 
-+    ReleaseFrames();
-     myBuffers.clear();
-     SizeList.clear();
-     Timecode           = 0;
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/matroska/0001-KaxBlock-rework-EBML-lacing-sizes-in-SCOPE_PARTIAL_D.patch deleted
=====================================
@@ -1,113 +0,0 @@
-From 058046e606eb60fcc0ce0ef3801ed11cf7e0e997 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Tue, 28 Apr 2026 10:08:39 +0200
-Subject: [PATCH 1/3] KaxBlock: rework EBML lacing sizes in SCOPE_PARTIAL_DATA
- mode
-
-We only read the bytes that correspond to frame sizes, rather
-than a guesstimate of how much data we are going to need.
-
-That's what the SCOPE_PARTIAL_DATA mode is about. This is already the case
-for LACING_XIPH. And we don't need a buffer allocation.
----
- src/KaxBlock.cpp | 63 ++++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 50 insertions(+), 13 deletions(-)
-
-diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
-index fd37ad5..5fab622 100644
---- a/src/KaxBlock.cpp
-+++ b/src/KaxBlock.cpp
-@@ -582,7 +582,6 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-       if (Result != 5)
-         throw SafeReadIOCallback::EndOfStreamX(0);
-       binary *cursor = _TempHead;
--      binary *_tmpBuf;
-       uint8 BlockHeadSize = 4;
- 
-       // update internal values
-@@ -656,32 +655,70 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-             SizeList[Index] = LastBufferSize;
-             break;
-           case LACING_EBML:
--            SizeRead = LastBufferSize;
--            cursor = _tmpBuf = new binary[FrameNum*4]; /// \warning assume the mean size will be coded in less than 4 bytes
--            Result += input.read(cursor, FrameNum*4);
--            FrameSize = ReadCodedSizeValue(cursor, SizeRead, SizeUnknown);
-+          {
-+            auto EBMLCodecLength = [](binary buf) {
-+              // TODO: use C23  stdc_leading_zeros_uc() as well as GCC/clang __builtin_clz()
-+              // __builtin_clz(buf) - 23;
-+              if (buf & 0x80)
-+                return 1;
-+              if (buf & 0x40)
-+                return 2;
-+              if (buf & 0x20)
-+                return 3;
-+              if (buf & 0x10)
-+                return 4;
-+              if (buf & 0x08)
-+                return 5;
-+              if (buf & 0x04)
-+                return 6;
-+              if (buf & 0x02)
-+                return 7;
-+              if (buf & 0x01)
-+                return 8;
-+              // invalid EBML coded length
-+              throw SafeReadIOCallback::EndOfStreamX(0);
-+            };
-+
-+            binary length_buf[8];
-+            if (input.read(length_buf, 1) != 1)
-+              throw SafeReadIOCallback::EndOfStreamX(0);
-+
-+            // get the length of the EBML coded value
-+            SizeRead = EBMLCodecLength(length_buf[0]);
-+            // read remaining needed bytes
-+            if (SizeRead > 1 && input.read(&length_buf[1], SizeRead - 1) != SizeRead - 1)
-+              throw SafeReadIOCallback::EndOfStreamX(0);
-+
-+            FrameSize = ReadCodedSizeValue(length_buf, SizeRead, SizeUnknown);
-             if (FrameSize > TotalLacedSize)
-               throw SafeReadIOCallback::EndOfStreamX(0);
-+
-+            FirstFrameLocation += SizeRead;
-             SizeList[0] = FrameSize;
--            cursor += SizeRead;
-             LastBufferSize -= FrameSize + SizeRead;
- 
-             for (Index=1; Index<FrameNum; Index++) {
--              // get the size of the frame
--              SizeRead = LastBufferSize;
--              FrameSize += ReadCodedSizeSignedValue(cursor, SizeRead, SizeUnknown);
-+              if (input.read(length_buf, 1) != 1)
-+                throw SafeReadIOCallback::EndOfStreamX(0);
-+
-+              // get the length of the EBML coded value
-+              SizeRead = EBMLCodecLength(length_buf[0]);
-+              // read remaining needed bytes
-+              if (SizeRead > 1 && input.read(&length_buf[1], SizeRead - 1) != SizeRead - 1)
-+                throw SafeReadIOCallback::EndOfStreamX(0);
-+
-+              FrameSize += ReadCodedSizeSignedValue(length_buf, SizeRead, SizeUnknown);
-               if (FrameSize > TotalLacedSize)
-                 throw SafeReadIOCallback::EndOfStreamX(0);
-+
-+              FirstFrameLocation += SizeRead;
-               SizeList[Index] = FrameSize;
--              cursor += SizeRead;
-               LastBufferSize -= FrameSize + SizeRead;
-             }
- 
--            FirstFrameLocation += cursor - _tmpBuf;
--
-             SizeList[Index] = LastBufferSize;
--            delete [] _tmpBuf;
-             break;
-+          }
-           case LACING_FIXED:
-             for (Index=0; Index<=FrameNum; Index++) {
-               // get the size of the frame
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/matroska/0001-KaxDefines-do-not-allow-infinite-sizes-on-all-Master.patch deleted
=====================================
@@ -1,37 +0,0 @@
-From 3c0d992c17acb32b5e57b228afac8e74eb773baf Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Mon, 27 Apr 2026 11:54:02 +0200
-Subject: [PATCH] KaxDefines: do not allow infinite sizes on all Master
- elements except Segment+Cluster
-
-Only Segment [^1] and Clusters [^2] are allowed to be infinite.
-
-[^1]: https://www.rfc-editor.org/rfc/rfc9559#section-5.1
-[^2]: https://www.rfc-editor.org/rfc/rfc9559#section-5.1.3
----
- matroska/KaxDefines.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/matroska/KaxDefines.h b/matroska/KaxDefines.h
-index 7734eb4..d29f6ab 100644
---- a/matroska/KaxDefines.h
-+++ b/matroska/KaxDefines.h
-@@ -62,6 +62,7 @@
- class MATROSKA_DLL_API x : public EbmlMaster { \
-     public: x(EBML_EXTRA_PARAM); \
-     x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
-+    bool SetSizeInfinite(bool finite = true) override { return !finite; } \
-     EBML_CONCRETE_CLASS(x)
- 
- #define DECLARE_MKX_MASTER_CONS(x)     DECLARE_MKX_CONTEXT(x) \
-@@ -150,6 +151,7 @@ class MATROSKA_DLL_API x : public EbmlMaster { \
- class MATROSKA_DLL_API x : public EbmlMaster { \
-     public: x(); \
-     x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
-+    bool SetSizeInfinite(bool finite = true) override { return !finite; } \
-     EBML_CONCRETE_CLASS(x)
- 
- #define DECLARE_MKX_MASTER_CONS(x)     DECLARE_MKX_CONTEXT(x) \
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/matroska/0002-KaxBlock-throw-when-the-EBML-length-difference-gives.patch deleted
=====================================
@@ -1,43 +0,0 @@
-From b4c4a7ef50b3bb8cac30975437c89a377240ef6f Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Tue, 28 Apr 2026 11:30:11 +0200
-Subject: [PATCH 2/3] KaxBlock: throw when the EBML length difference gives a
- negative frame length
-
----
- src/KaxBlock.cpp | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
-index 5fab622..ddf8b14 100644
---- a/src/KaxBlock.cpp
-+++ b/src/KaxBlock.cpp
-@@ -533,7 +533,11 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-             for (Index=1; Index<FrameNum; Index++) {
-               // get the size of the frame
-               SizeRead = LastBufferSize;
--              FrameSize += ReadCodedSizeSignedValue(BufferStart + Mem.GetPosition(), SizeRead, SizeUnknown);
-+              auto FrameSizeDiff = ReadCodedSizeSignedValue(BufferStart + Mem.GetPosition(), SizeRead, SizeUnknown);
-+              if (FrameSizeDiff < 0 && FrameSize <= -FrameSizeDiff)
-+                // invalid negative or 0 frame size
-+                throw SafeReadIOCallback::EndOfStreamX(SizeRead);
-+              FrameSize += FrameSizeDiff;
-               if (!FrameSize || (static_cast<uint32>(FrameSize + SizeRead) > LastBufferSize))
-                 throw SafeReadIOCallback::EndOfStreamX(SizeRead);
-               SizeList[Index] = FrameSize;
-@@ -707,7 +711,11 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-               if (SizeRead > 1 && input.read(&length_buf[1], SizeRead - 1) != SizeRead - 1)
-                 throw SafeReadIOCallback::EndOfStreamX(0);
- 
--              FrameSize += ReadCodedSizeSignedValue(length_buf, SizeRead, SizeUnknown);
-+              auto FrameSizeDiff = ReadCodedSizeSignedValue(length_buf, SizeRead, SizeUnknown);
-+              if (FrameSizeDiff < 0 && FrameSize <= -FrameSizeDiff)
-+                // invalid negative or 0 frame size
-+                throw SafeReadIOCallback::EndOfStreamX(0);
-+              FrameSize += FrameSizeDiff;
-               if (FrameSize > TotalLacedSize)
-                 throw SafeReadIOCallback::EndOfStreamX(0);
- 
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/matroska/0003-KaxBlock-fix-reading-EBML-lacing-with-just-one-frame.patch deleted
=====================================
@@ -1,43 +0,0 @@
-From 66e4f59d325afc159b7a1e05683dd8b8698459ea Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Mon, 11 May 2026 09:43:20 +0200
-Subject: [PATCH 3/3] KaxBlock: fix reading EBML lacing with just one frame
-
-The spec [^1] is not clear whether when there is a single frame in the lace
-the size of the frame should be written. However it is forbidden to put
-a single frame in a lace [^2]. libmatroska doesn't support it.
-libavformat doesn't support lacing writing.
-However the last frame size is never written in any lace, so that's the
-first one when there's only one frame.
-
-[^1]: https://www.rfc-editor.org/rfc/rfc9559#section-10.3.3
-[^2]: https://www.rfc-editor.org/rfc/rfc9559#section-10.3
----
- src/KaxBlock.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
-index ddf8b14..eccb4c7 100644
---- a/src/KaxBlock.cpp
-+++ b/src/KaxBlock.cpp
-@@ -683,6 +683,9 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-               throw SafeReadIOCallback::EndOfStreamX(0);
-             };
- 
-+            if (FrameNum == 0)
-+              Index = 0;
-+            else {
-             binary length_buf[8];
-             if (input.read(length_buf, 1) != 1)
-               throw SafeReadIOCallback::EndOfStreamX(0);
-@@ -723,6 +726,7 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
-               SizeList[Index] = FrameSize;
-               LastBufferSize -= FrameSize + SizeRead;
-             }
-+            }
- 
-             SizeList[Index] = LastBufferSize;
-             break;
--- 
-2.52.0.windows.1
-


=====================================
contrib/src/matroska/SHA512SUMS
=====================================
@@ -1 +1 @@
-a6f38d388f6c9bfe399b9263ba4ef0965cfb4e27b39ac04453d5c9a9db8eac719a04c87b58d88b612902297e17aa7437382a66332f3f5b3d41744a13351751fd  libmatroska-1.7.1.tar.xz
+86b21a0ff3e5149a2824a9f21f9460179d02aecf477f2b9f1f92ce2f991033bd0cb209d81a4aeee2c0c5ffc193dac57a84dd4f529939b12c900f2cfb881618fb  libmatroska-1.7.2.tar.xz


=====================================
contrib/src/matroska/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # matroska
 
-MATROSKA_VERSION := 1.7.1
+MATROSKA_VERSION := 1.7.2
 MATROSKA_URL := https://dl.matroska.org/downloads/libmatroska/libmatroska-$(MATROSKA_VERSION).tar.xz
 
 PKGS += matroska
@@ -19,17 +19,11 @@ $(TARBALLS)/libmatroska-$(MATROSKA_VERSION).tar.xz:
 matroska: libmatroska-$(MATROSKA_VERSION).tar.xz .sum-matroska
 	$(UNPACK)
 	$(call pkg_static,"libmatroska.pc.in")
-	$(APPLY) $(SRC)/matroska/0001-KaxDefines-do-not-allow-infinite-sizes-on-all-Master.patch
-	$(APPLY) $(SRC)/matroska/0001-KaxBlock-release-read-buffers-on-EndOfStream-error.patch
-	$(APPLY) $(SRC)/matroska/0001-KaxBlock-rework-EBML-lacing-sizes-in-SCOPE_PARTIAL_D.patch
-	$(APPLY) $(SRC)/matroska/0002-KaxBlock-throw-when-the-EBML-length-difference-gives.patch
-	$(APPLY) $(SRC)/matroska/0003-KaxBlock-fix-reading-EBML-lacing-with-just-one-frame.patch
-	$(APPLY) $(SRC)/matroska/0001-KaxBlock-expand-FrameNum-after-reading.patch
 	$(MOVE)
 
 .matroska: matroska toolchain.cmake
 	$(CMAKECLEAN)
-	$(HOSTVARS_CMAKE) $(CMAKE) -DCMAKE_POLICY_VERSION_MINIMUM=3.5
+	$(HOSTVARS_CMAKE) $(CMAKE)
 	+$(CMAKEBUILD)
 	$(CMAKEINSTALL)
 	touch $@



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e394ca66d2225bb9c2e69bcd5310fda5506321c1...08510c27c4a50d3212f7e34171e73453028885d1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e394ca66d2225bb9c2e69bcd5310fda5506321c1...08510c27c4a50d3212f7e34171e73453028885d1
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list