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 681818 - h264parse: evaluate vui parameters only when they where parsed and set
h264parse: evaluate vui parameters only when they where parsed and set
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.23
Other Linux
: Normal normal
: 1.0.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-14 08:53 UTC by Peter Seiderer
Modified: 2013-01-16 10:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for h264parse to evaluate vui parameters only when they where parsed and set (2.71 KB, patch)
2012-08-14 08:53 UTC, Peter Seiderer
none Details | Review

Description Peter Seiderer 2012-08-14 08:53:27 UTC
Created attachment 221105 [details] [review]
patch for h264parse to evaluate vui parameters only when they where parsed and set

Testpipeline:

GST_DEBUG=h264*:5 gst-launch filesrc location=test.mpg  ! mpegpsdemux ! h264parse ! fakesink 2>&1 | grep ratio

0:00:00.447200775  1381    0x8d200 INFO               h264parse gsth264parse.c:1070:gst_h264_parse_update_src_caps:<h264parse0> aspect ratio idc changed 144
0:00:00.901053845  1381    0x8d200 INFO               h264parse gsth264parse.c:1070:gst_h264_parse_update_src_caps:<h264parse0> aspect ratio idc changed 145
....

The Problem is evaluation of vui_parameters which are not set or not parsed (and so h264pase compares uninitialized memory)....
Comment 1 Mark Nauwelaerts 2013-01-15 19:14:53 UTC
Thanks for noting this, but if I read things right, it should suffice to 0-initialize the SPS VUI parameters (so all the _present flags end up 0), which is done in the following commit:

[on master]
commit c20d13d8f8e54e3ee01f85d41a9f17ff359b5215
Author: Mark Nauwelaerts <mnauw@users.sourceforge.net>
Date:   Sat Jan 12 13:15:02 2013 +0100

    codecparsers: h264: zero-initialize SPS VUI parameters
    
    ... so all 'present' flags indicate no presence of optional parts
    in case VUI parameters end up not being parsed.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681818

[on 0.10]
commit c20d13d8f8e54e3ee01f85d41a9f17ff359b5215
Author: Mark Nauwelaerts <mnauw@users.sourceforge.net>
Date:   Sat Jan 12 13:15:02 2013 +0100

    codecparsers: h264: zero-initialize SPS VUI parameters
    
    ... so all 'present' flags indicate no presence of optional parts
    in case VUI parameters end up not being parsed.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681818

[Not sure/clear about 1.0 branch these days ...]
Comment 2 Tim-Philipp Müller 2013-01-15 19:25:28 UTC
> [Not sure/clear about 1.0 branch these days ...]

Feel free to cherry-pick into 1.0 (or whatever the current 'stable release' branch du jour is) if you think a commit is obviously correct or safe / unlikely to break anything.
Comment 3 Mark Nauwelaerts 2013-01-15 20:25:03 UTC
... and so on 1.0:

commit fb900e6bd0d88f0d9ee502dfc349227d2845b6ca
Author: Mark Nauwelaerts <mnauw@users.sourceforge.net>
Date:   Sat Jan 12 13:15:02 2013 +0100

    codecparsers: h264: zero-initialize SPS VUI parameters
    
    ... so all 'present' flags indicate no presence of optional parts
    in case VUI parameters end up not being parsed.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681818