1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-07 03:56:28 +02:00

contrib: update libmatroska to 1.5.1

This commit is contained in:
Steve Lhomme 2019-05-27 09:11:03 +02:00
parent 7196586c6d
commit cfb18f369d
4 changed files with 2 additions and 87 deletions

View File

@ -1,54 +0,0 @@
From 1ec615ec2b825523ecb1132794bbe771d2817b70 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 11 Feb 2019 12:15:58 +0100
Subject: [PATCH] KaxBlock: do not attempt to use laced sizes that are clearly
invalid
---
src/KaxBlock.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
index 878d9a2..a1df83e 100644
--- a/src/KaxBlock.cpp
+++ b/src/KaxBlock.cpp
@@ -628,7 +628,8 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
// put all Frames in the list
if (mLacing != LACING_NONE) {
// read the number of frames in the lace
- uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame
+ const uint32 TotalLacedSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame
+ uint32 LastBufferSize = TotalLacedSize;
uint8 FrameNum = _TempHead[0]; // number of frames in the lace - 1
// read the list of frame sizes
uint8 Index;
@@ -646,6 +647,8 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
do {
Result += input.read(_TempHead, 1);
FrameSize += uint8(_TempHead[0]);
+ if (FrameSize > TotalLacedSize)
+ throw SafeReadIOCallback::EndOfStreamX(0);
LastBufferSize--;
FirstFrameLocation++;
@@ -662,6 +665,8 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
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);
+ if (FrameSize > TotalLacedSize)
+ throw SafeReadIOCallback::EndOfStreamX(0);
SizeList[0] = FrameSize;
cursor += SizeRead;
LastBufferSize -= FrameSize + SizeRead;
@@ -670,6 +675,8 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
// get the size of the frame
SizeRead = LastBufferSize;
FrameSize += ReadCodedSizeSignedValue(cursor, SizeRead, SizeUnknown);
+ if (FrameSize > TotalLacedSize)
+ throw SafeReadIOCallback::EndOfStreamX(0);
SizeList[Index] = FrameSize;
cursor += SizeRead;
LastBufferSize -= FrameSize + SizeRead;
--
2.19.1.windows.1

View File

@ -1,29 +0,0 @@
From 3fa2eeae1d9148b00ff7cebda7304de90ece575b Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 11 Feb 2019 09:51:30 +0100
Subject: [PATCH] KaxBlock: don't reset potentially unallocated memory
When using SCOPE_PARTIAL_DATA the GetBuffer()/Data pointer is never allocated.
If this exception occurs we must not write on NULL pointed data.
When the memory is allocated it doesn't have any use to reset the memory to 0
since SetValueIsSet(false) is called right before, invalidating the buffer.
---
src/KaxBlock.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
index 3fa18e5..878d9a2 100644
--- a/src/KaxBlock.cpp
+++ b/src/KaxBlock.cpp
@@ -703,7 +703,6 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
} catch (SafeReadIOCallback::EndOfStreamX &) {
SetValueIsSet(false);
- std::memset(EbmlBinary::GetBuffer(), 0, GetSize());
myBuffers.clear();
SizeList.clear();
Timecode = 0;
--
2.19.1.windows.1

View File

@ -1 +1 @@
281224b66ce7ef39daf0f186cda1144250e190b914e64f4f2524e8bf0170a3d18dbc50f204d4ca8d7eaffe183a61f96c92ba6ec4325bacb068272d62cdbcef33 libmatroska-1.4.9.tar.xz
5c65b903abd2f42e2270749c0570b1c1f7d65f87d7eb6a3f5480af3cee6614c74b3566858f1afe3c71cdea6085c1a114e53b08bfb043691018ee7f23ce4b8ef2 libmatroska-1.5.1.tar.xz

View File

@ -1,6 +1,6 @@
# matroska
MATROSKA_VERSION := 1.4.9
MATROSKA_VERSION := 1.5.1
MATROSKA_URL := http://dl.matroska.org/downloads/libmatroska/libmatroska-$(MATROSKA_VERSION).tar.xz
PKGS += matroska
@ -18,8 +18,6 @@ $(TARBALLS)/libmatroska-$(MATROSKA_VERSION).tar.xz:
libmatroska: libmatroska-$(MATROSKA_VERSION).tar.xz .sum-matroska
$(UNPACK)
$(APPLY) $(SRC)/matroska/0001-KaxBlock-don-t-reset-potentially-unallocated-memory.patch
$(APPLY) $(SRC)/matroska/0001-KaxBlock-do-not-attempt-to-use-laced-sizes-that-are-.patch
$(call pkg_static,"libmatroska.pc.in")
$(MOVE)