videodecoder: fix segfault copying buffer metas
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Wed, 21 Jun 2023 11:45:13 +0000 (13:45 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 18 Jul 2023 12:22:10 +0000 (12:22 +0000)
commitee43b6421e568e6406751222f702432d7b786507
treea6b9ccc4c42ed588afe4daa142356f80e8b1234e
parenta1d2cea9135d6a2fa3f6ec2c8eb9ceaa8d74b093
videodecoder: fix segfault copying buffer metas

The current implementation copies metas without checking if the buffer
is writable.

The operation that needs to be done, replacing the input buffer and
copying the metas, is only part of that process. We create a new function
that does both.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5054>
subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c
subprojects/gst-plugins-base/tests/check/libs/videodecoder.c