chromecast: always quit thread in Dead state
[vlc.git] / contrib / src / ebml / unknown-check.patch
blob895a4d664e937eddb2adfe58795a453134e517bc
1 From ff0dc3cc21494578ce731f5d7dcde5fdec23d40f Mon Sep 17 00:00:00 2001
2 From: Steve Lhomme <slhomme@matroska.org>
3 Date: Wed, 6 Dec 2017 09:32:13 +0100
4 Subject: [PATCH] Do not output an element with size Unknown if it's not
5 allowed
7 Similar to what is done in FindNextID().
9 SetSizeInfinite() doesn't actually set anything. SetSizeIsFinite() is the one
10 that actually sets it and it is an internal API.
11 ---
12 src/EbmlElement.cpp | 14 ++++++--------
13 1 file changed, 6 insertions(+), 8 deletions(-)
15 diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp
16 index ae4441e..ac0be41 100644
17 --- a/src/EbmlElement.cpp
18 +++ b/src/EbmlElement.cpp
19 @@ -461,15 +461,13 @@ EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSe
20 // 1 : same level
21 // + : further parent
22 if (Result->ValidateSize() && (SizeFound == SizeUnknown || UpperLevel > 0 || MaxDataSize == 0 || MaxDataSize >= (PossibleID_Length + PossibleSizeLength + SizeFound))) {
23 - if (SizeFound == SizeUnknown) {
24 - Result->SetSizeInfinite();
25 + if (SizeFound != SizeUnknown || Result->SetSizeInfinite()) {
26 + Result->SizePosition = DataStream.getFilePointer() - SizeIdx + EBML_ID_LENGTH(PossibleID);
27 + Result->ElementPosition = Result->SizePosition - EBML_ID_LENGTH(PossibleID);
28 + // place the file at the beggining of the data
29 + DataStream.setFilePointer(Result->SizePosition + _SizeLength);
30 + return Result;
33 - Result->SizePosition = DataStream.getFilePointer() - SizeIdx + EBML_ID_LENGTH(PossibleID);
34 - Result->ElementPosition = Result->SizePosition - EBML_ID_LENGTH(PossibleID);
35 - // place the file at the beggining of the data
36 - DataStream.setFilePointer(Result->SizePosition + _SizeLength);
37 - return Result;
40 delete Result;
41 --
42 2.10.1.windows.1