]> git.webhop.me Git - bs-cst-neutrino-hd.git/commitdiff
libdvbsi++: fix-descriptorLenghth
authorMarkham <markham001@gmx.de>
Wed, 31 Oct 2018 22:55:15 +0000 (23:55 +0100)
committerMarkham <markham001@gmx.de>
Wed, 31 Oct 2018 22:55:15 +0000 (23:55 +0100)
thx Satbaby
fix_ac3_descriptor
fix_network_id

archive-patches/libdvbsi++-fix-descriptorLenghth.patch [new file with mode: 0644]
archive-patches/libdvbsi++-fix_ac3_descriptor.patch [new file with mode: 0644]
archive-patches/libdvbsi++-fix_network_id.patch [new file with mode: 0644]
make/libraries.mk

diff --git a/archive-patches/libdvbsi++-fix-descriptorLenghth.patch b/archive-patches/libdvbsi++-fix-descriptorLenghth.patch
new file mode 100644 (file)
index 0000000..2a7202c
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/src/descriptor.cpp b/src/descriptor.cpp
+index 8c914a9..beaf4d7 100644
+--- a/src/descriptor.cpp
++++ b/src/descriptor.cpp
+@@ -17,6 +17,9 @@ Descriptor::Descriptor(const uint8_t * const buffer)
+       descriptorTag = buffer[0];
+       descriptorLength = buffer[1];
++      if (!descriptorLength)
++              descriptorLength = 1;
++
+       dataBytes.resize(descriptorLength);
+       memcpy(&dataBytes[0], &buffer[2], descriptorLength);
diff --git a/archive-patches/libdvbsi++-fix_ac3_descriptor.patch b/archive-patches/libdvbsi++-fix_ac3_descriptor.patch
new file mode 100644 (file)
index 0000000..d424b28
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/src/ac3_descriptor.cpp
++++ b/src/ac3_descriptor.cpp
+@@ -31,6 +31,16 @@ Ac3Descriptor::Ac3Descriptor(const uint8_t * const buffer) : Descriptor(buffer)
+       asvcFlag = (buffer[2] >> 4) & 0x01;
+       size_t headerLength = 1 + ac3TypeFlag + bsidFlag + mainidFlag + asvcFlag;
++
++      // broadcasters got it wrong again...
++      if (headerLength > descriptorLength) {
++              ac3TypeFlag = 0;
++              bsidFlag = 0;
++              mainidFlag = 0;
++              asvcFlag = 0;
++              return;
++      }
++
+       ASSERT_MIN_DLEN(headerLength);
+       size_t i = 3;
diff --git a/archive-patches/libdvbsi++-fix_network_id.patch b/archive-patches/libdvbsi++-fix_network_id.patch
new file mode 100644 (file)
index 0000000..596a05a
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/include/dvbsi++/network_information_section.h
++++ b/include/dvbsi++/network_information_section.h
+@@ -37,6 +37,7 @@ typedef TransportStreamInfoList::const_iterator TransportStreamInfoConstIterator
+ class NetworkInformationSection : public LongCrcSection, public DescriptorContainer
+ {
+       protected:
++              unsigned networkId                              : 16;
+               unsigned networkDescriptorsLength               : 12;
+               unsigned transportStreamLoopLength              : 12;
+               TransportStreamInfoList tsInfo;
+@@ -49,6 +50,7 @@ class NetworkInformationSection : public LongCrcSection, public DescriptorContai
+               static const enum TableId TID = TID_NIT_ACTUAL;
+               static const uint32_t TIMEOUT = 12000;
++              uint16_t getNetworkId(void) const;
+               const TransportStreamInfoList *getTsInfo(void) const;
+ };
+--- a/src/network_information_section.cpp
++++ b/src/network_information_section.cpp
+@@ -35,6 +35,7 @@ uint16_t TransportStreamInfo::getOriginalNetworkId(void) const
+ NetworkInformationSection::NetworkInformationSection(const uint8_t * const buffer) : LongCrcSection(buffer)
+ {
++      networkId = UINT16(&buffer[3]);
+       networkDescriptorsLength = sectionLength > 9 ? DVB_LENGTH(&buffer[8]) : 0;
+       
+       uint16_t pos = 10;
+@@ -68,6 +69,11 @@ NetworkInformationSection::~NetworkInformationSection(void)
+               delete *i;
+ }
++uint16_t NetworkInformationSection::getNetworkId(void) const
++{
++      return networkId;
++}
++
+ const TransportStreamInfoList *NetworkInformationSection::getTsInfo(void) const
+ {
+       return &tsInfo;
index 53935e5671a1c832fa0ab3bdfa737c1e054b33d4..757d82b8653eade1b1a34f082b6bcb1f41e1b2a2 100755 (executable)
@@ -711,6 +711,9 @@ $(D)/libdvbsi++: $(ARCHIVE)/libdvbsi++-$(LIBDVBSI_GIT).tar.bz2 | $(TARGETPREFIX)
                $(PATCH)/libdvbsi++-src-time_date_section.cpp-fix-sectionLength-check.patch; \
                $(PATCH)/libdvbsi++-fix-unaligned-access-on-SuperH.patch; \
                $(PATCH)/libdvbsi++-content_identifier_descriptor.patch; \
+               $(PATCH)/libdvbsi++-fix_network_id.patch; \
+               $(PATCH)/libdvbsi++-fix_ac3_descriptor.patch; \
+               $(PATCH)/libdvbsi++-fix-descriptorLenghth.patch; \
                $(CONFIGURE) CPPFLAGS=$(DVBSI_CPPFLAG) \
                        --prefix=$(TARGETPREFIX) \
                        --build=$(BUILD) \