After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725008 - matroskademux: crash with 24bit raw audio
matroskademux: crash with 24bit raw audio
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal major
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-23 18:12 UTC by Matej Knopp
Modified: 2014-02-27 00:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to not set the alignment to add numbers (1.44 KB, patch)
2014-02-23 18:12 UTC, Matej Knopp
reviewed Details | Review

Description Matej Knopp 2014-02-23 18:12:46 UTC
Created attachment 270060 [details] [review]
Patch to not set the alignment to add numbers

The demuxer sets context->alignment to bitdepth / 8, which is 3. 

Later it tries to align the sub buffer to 3

sub = gst_matroska_demux_align_buffer (demux, sub, stream->alignment);

which fails and returns NULL, which causes crash in next line
Comment 1 Tim-Philipp Müller 2014-02-25 12:09:32 UTC
Would you agree that context->alignment should end up being a power of 2 not just a multiple of 2? (Hypothetical case: bits=40 -> alignment=5 -> fixed alignment=6 bytes)
Comment 2 Matej Knopp 2014-02-25 17:19:15 UTC
I guess so. Alignment = 6bytes does seem weird.
Comment 3 Tim-Philipp Müller 2014-02-27 00:55:56 UTC
commit f3163fb45f748f63d13e1f63273b7155f22e3070
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Thu Feb 27 00:43:48 2014 +0000

    matroskademux: align raw audio memory to powers of two
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725008

commit c3dc53e55162df238aecbb1b7f065cf342d6df73
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Thu Feb 27 00:37:20 2014 +0000

    matroskademux: calculate alignment properly for audio depths not a multiple of 8

commit d33b4dce63c967dedd5477fc76ecd27fec434d49
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Sun Feb 23 19:09:24 2014 +0100

    matroskademux: fix crash with 24-bit raw audio
    
    Do not try to align audio buffers to odd numbers,
    which will get us a NULL buffer which we then
    crash on.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725008