[PATCH] BUG - SCTE Descriptor 8A always fails to parse

Steven Toth <[email protected]> Tue, 11 Jul 2017 18:50:30 -0400
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <[email protected]>
--Apple-Mail=_801A2C37-CA7A-4A69-AA91-3E1CEB44F956
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Found a bug, libdvbpsi isn=E2=80=99t parsing SCTE descriptor 0x8a =
correctly. The descriptor according to the formal specification (2004 =
through 2016) states that the payload is always one byte long. The =
parser rejects descriptors with a single byte of payload.

http://www.scte.org/SCTEDocs/Standards/SCTE%2035%202016.pdf

See page 19 section 8.2 for the correct descriptor specification (single =
byte).

Patch attached.


--Apple-Mail=_801A2C37-CA7A-4A69-AA91-3E1CEB44F956
Content-Disposition: attachment;
	filename=0001-SCTE35-CUEI-Descriptor-parsing-bug.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="0001-SCTE35-CUEI-Descriptor-parsing-bug.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=206afd14cf08001b0a871c7254f7e012c780622f45=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Steven=20Toth=20<[email protected]>=0ADate:=20=
Tue,=2011=20Jul=202017=2018:27:29=20-0400=0ASubject:=20[PATCH]=20SCTE35=20=
/=20CUEI=20Descriptor=20parsing=20bug.=20Descriptor=20lengths=20of=0A=20=
one=20byte=20fail=20to=20parse,=20instead=20returning=20null.=0A=0AThe=20=
Spec=20from=202004=20to=202016=20shows=20the=20descriptor=20payload=20=
has=20never=20been=0Amore=20than=20a=20single=20byte.=0ASee=20SCTE=2035=20=
2016=20Page=2019=20Table=202=20(Section=208.2).=0A=0ACorrect=20the=20=
length=20validation=20check,=20and=20reject=20any=20descriptor=20that=0A=
IS=20NOT=20one=20byte=20long,=20as=20per=20the=20spec.=0A---=0A=20=
src/descriptors/custom/dr_8a_scte.c=20|=202=20+-=0A=201=20file=20=
changed,=201=20insertion(+),=201=20deletion(-)=0A=0Adiff=20--git=20=
a/src/descriptors/custom/dr_8a_scte.c=20=
b/src/descriptors/custom/dr_8a_scte.c=0Aindex=204ce847e..0639b8c=20=
100644=0A---=20a/src/descriptors/custom/dr_8a_scte.c=0A+++=20=
b/src/descriptors/custom/dr_8a_scte.c=0A@@=20-53,7=20+53,7=20@@=20=
dvbpsi_scte_cuei_dr_t=20*=20=
dvbpsi_decode_scte_cuei_dr(dvbpsi_descriptor_t=20*=20p_descr=0A=20=20=20=20=
=20if=20(dvbpsi_IsDescriptorDecoded(p_descriptor))=0A=20=20=20=20=20=20=20=
=20=20return=20p_descriptor->p_decoded;=0A=20=0A-=20=20=20=20if=20=
(p_descriptor->i_length=20=3D=3D=200x01)=0A+=20=20=20=20if=20=
(p_descriptor->i_length=20!=3D=200x01)=0A=20=20=20=20=20=20=20=20=20=
return=20NULL;=0A=20=0A=20=20=20=20=20/*=20Allocate=20memory=20*/=0A--=20=
=0A2.8.4=20(Apple=20Git-73)=0A=0A=

--Apple-Mail=_801A2C37-CA7A-4A69-AA91-3E1CEB44F956
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


=E2=80=94
Steven Toth - LTN Global
[email protected]



--Apple-Mail=_801A2C37-CA7A-4A69-AA91-3E1CEB44F956
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGliZHZicHNp
LWRldmVsIG1haWxpbmcgbGlzdApsaWJkdmJwc2ktZGV2ZWxAdmlkZW9sYW4ub3JnCmh0dHBzOi8v
bWFpbG1hbi52aWRlb2xhbi5vcmcvbGlzdGluZm8vbGliZHZicHNpLWRldmVsCg==

--Apple-Mail=_801A2C37-CA7A-4A69-AA91-3E1CEB44F956--