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 720810 - audio/video: Initialize all {audio|video}info fields
audio/video: Initialize all {audio|video}info fields
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-12-20 07:47 UTC by Edward Hervey
Modified: 2013-12-30 09:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audio/video: Initialize all {audio|video}info fields (1.52 KB, patch)
2013-12-20 07:47 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2013-12-20 07:47:32 UTC
Fixes "Unitialized Scalar Variable" issues reported by Coverity.

Has the added advantage of detecting whether somebody *does* use those
fields (ending up with a invalid address).
Comment 1 Edward Hervey 2013-12-20 07:47:34 UTC
Created attachment 264604 [details] [review]
audio/video: Initialize all {audio|video}info fields
Comment 2 Sebastian Dröge (slomo) 2013-12-20 12:29:08 UTC
NULL would be invalid enough IMHO ;) But sure, get this pushed and after that the coverty reports can actually be used in a useful way.
Comment 3 Edward Hervey 2013-12-20 14:04:47 UTC
And updated all related coverity issues to "Fix submitted"

commit b97c711defc9f8f7bb77f7cc4dfb4d85fb33b7f8
Author: Edward Hervey <edward@collabora.com>
Date:   Fri Dec 20 08:41:45 2013 -0500

    audio/video: Initialize all {audio|video}info fields
    
    Fixes "Unitialized Scalar Variable" issues reported by Coverity.
    
    Has the added advantage of detecting whether somebody *does* use those
    fields (ending up with a invalid address).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720810
Comment 4 Nicolas Dufresne (ndufresne) 2013-12-23 15:49:01 UTC
This is a bit poblematic as the _gst_reserved will be moved inside an abidata union when we need to extend the API, and then we'd clear the new item. Also, it does solve the problem with unitinilisized stride and offset for format where the number of planes is smaller then 4.

Why can't we simply clear all of GstVideoInfo ?

i.e. memset (info, 0xff, sizeof (GstVideoInfo));
Comment 5 Sebastian Dröge (slomo) 2013-12-23 18:03:15 UTC
Yes please
Comment 6 Sebastian Dröge (slomo) 2013-12-30 09:15:38 UTC
commit 65732d9c97dd2091994c88167501e85de5e5755d
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Mon Dec 30 10:14:09 2013 +0100

    audio/video-info: Initialize the complete struct to 0 in the beginning
    
    Instead of only initializing some parts in some code paths. Also
    makes it easier to use the reserved bits of the structs later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720810