subparse: don't try to index string with -1
authorMatthew Waters <matthew@centricular.com>
Sun, 10 Apr 2022 00:55:02 +0000 (10:55 +1000)
committerMatthew Waters <matthew@centricular.com>
Sun, 10 Apr 2022 00:57:08 +0000 (10:57 +1000)
commitc2ac57f6c970ab6129507bb04bcea47a693ab17f
tree1a8a3911ff0de6f3b9c1767d5fb38da9afbd6ad7
parentaa121fd12053ba14dc30631ec4778965134bd68d
subparse: don't try to index string with -1

If the len of the string turns out to be 0, str[len - 1] resolved to
str[-1] which is not a good idea.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46543
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2147>
subprojects/gst-plugins-base/gst/subparse/gstsubparseelement.c