MPEG-TS, Rust, and C strings – the ongoing saga
Russel Winder
russel at winder.org.uk
Fri Jul 19 14:20:48 UTC 2019
On Fri, 2019-07-19 at 09:05 +0300, Sebastian Dröge wrote:
> […]
>
> Reproduce it in C if you're unsure about that. It's most likely not a
> bindings problem as the -sys bindings *are* basically C.
I relented and wrote a C program. It turns out that
gst_mpegts_descriptor_parse_dvb_short_event can return success and yet leave
the event_name and text out parameters null: if it cannot parse the strings
for some reason it leaves the out parameter null and yet returns success – I
think because the language_code was successfully parsed, even if parsing the
event_name and text failed.
Thus the SIGSEGV must be because CStr::from_ptr fails to check for a null
argument, so when it calls sys::strlen it cannot cope. Thus it seems the
actual error here is in the Rust code – though I think there are clearly
problems in the C code.
--
Russel.
===========================================
Dr Russel Winder t: +44 20 7585 2200
41 Buckmaster Road m: +44 7770 465 077
London SW11 1EN, UK w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190719/caf97037/attachment.sig>
More information about the gstreamer-devel
mailing list