baseparse: Don't return more data than asked for in pull_range()
authorJan Schmidt <jan@centricular.com>
Wed, 8 Apr 2020 07:53:17 +0000 (17:53 +1000)
committerJan Schmidt <jan@centricular.com>
Wed, 8 Apr 2020 09:13:25 +0000 (19:13 +1000)
commite94ad24b9f8a1d285f66ffc7a0829bda5810adda
treea7450b5377f2770fbd4d0cd74353742e4a91a8e7
parentcbdc259865d9667f30f3f0e9dfc5a3ce12e0266a
baseparse: Don't return more data than asked for in pull_range()

Even when pulling a new 64KB buffer from upstream, don't return
more data than was asked for in the pull_range() method and then
return less later, as that confused subclasses like h264parse.

Add a unit test that when a subclass asks for more data, it always
receives a larger buffer on the next iteration, never less.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/530
libs/gst/base/gstbaseparse.c
tests/check/libs/baseparse.c