• Tim-Philipp Müller's avatar
    decodebin2: fix pad leak and problem with GWeakRef code · cd42611c
    Tim-Philipp Müller authored
    Follow-up to !160 and commit 6a99ad2c.
    
    Firstly, don't leak the sinkpad. g_weak_ref_get() returns
    a strong reference (unless it returns NULL), so that must
    be unrefed, as detected by the playbin-complex and
    discoverer unit tests.
    
    Next, if we do that we get invalid memory access when the
    final pad ref is dropped a few lines below after the
    request pad is released. The reason for this is that
    GWeakRefs are not movable once they're in use, because
    their address will be stored inside the object. In this
    case the GWeakRef was embedded inside the GstDemuxerPad
    struct which in turn was embedded inside the GArray data
    section, and when the GArray gets resized, the structs
    move. Just KISS and use a list with individual allocations
    for each DemuxerPad instead.
    cd42611c
Name
Last commit
Last update
common @ f0c2dc9a Loading commit data...
docs Loading commit data...
ext Loading commit data...
gst Loading commit data...
gst-libs Loading commit data...
hooks Loading commit data...
m4 Loading commit data...
pkgconfig Loading commit data...
po Loading commit data...
sys Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.LIB Loading commit data...
ChangeLog Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
README.static-linking Loading commit data...
RELEASE Loading commit data...
REQUIREMENTS Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
gst-plugins-base.doap Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...