matroskademux: header parsing fixes
matroskademux: Initialize track context out parameter to NULL before parsing
Various error return paths don't set it to NULL and callers are only
checking if the pointer is NULL. As it's allocated on the stack this
usually contains random stack memory, and more often than not the memory
of a previously parsed track.
This then causes all kinds of memory corruptions further down the line.
Thanks to Natalie Silvanovich for reporting.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/858
matroskademux: Fix extraction of multichannel WavPack
The old code had a couple of issues that all lead to potential memory
safety bugs.
- Use a constant for the Wavpack4Header size instead of using sizeof.
It's written out into the data and not from the struct and who knows
what special alignment/padding requirements some C compilers have.
- gst_buffer_set_size() does not realloc the buffer when setting a
bigger size than allocated, it only allows growing up to the maximum
allocated size. Instead use a GstAdapter to collect all the blocks
and take out everything at once in the end.
- Check that enough data is actually available in the input and
otherwise handle it an error in all cases instead of silently
ignoring it.
Merge request reports
Activity
mentioned in commit tpm/gst-plugins-good@242f3cae
mentioned in commit tpm/gst-plugins-good@6c461e90
added 1.14 1.16 1.18 Needs backport labels
mentioned in commit tpm/gst-plugins-good@6a03c578
mentioned in commit tpm/gst-plugins-good@7e55e4ad
added Backported into 1.18 label
Merge Request for backport into 1.18 branch: !903 (merged) (target milestone: 1.18.4)
mentioned in merge request !903 (merged)
mentioned in commit tpm/gst-plugins-good@ae545bc6
mentioned in commit tpm/gst-plugins-good@b6c418d9
added Backported into 1.16 label
Merge Request for backport into 1.16 branch: !904 (merged) (target milestone: None)
mentioned in merge request !904 (merged)
mentioned in commit tpm/gst-plugins-good@aad0b6e4
mentioned in commit tpm/gst-plugins-good@fc0c8ad4
added Backported into 1.14 label and removed Needs backport label
Merge Request for backport into 1.14 branch: !905 (merged) (target milestone: None)
mentioned in merge request !905 (merged)
assigned to @tpm and unassigned @gstreamer-merge-bot