samiparse: fix handling of self-closing tags
authorTim-Philipp Müller <tim@centricular.com>
Wed, 29 Jun 2022 23:13:19 +0000 (00:13 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 1 Jul 2022 17:24:52 +0000 (17:24 +0000)
commit84a3b0ef87e1b4eebe3ebef2c0de620a40afe4c1
tree6c4669417cba1087d0d919f3b6e6a210ab9e8032
parent79d8b435d7b346e65a683eee988e4b1084159428
samiparse: fix handling of self-closing tags

We would check the wrong string (rest of line rather than element)
for the / suffix of self-closing tags, which is not only wrong but
also has atrocious performance with certain strings like the garbled
nonsense clusterfuzz feeds us, which might cause discoverer to time
out when processing garbled SAMI files.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47461

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2685>
subprojects/gst-plugins-base/gst/subparse/samiparse.c
subprojects/gst-plugins-base/tests/check/elements/subparse.c