GNOME Bugzilla – Bug 720810
audio/video: Initialize all {audio|video}info fields
Last modified: 2013-12-30 09:15:41 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).
Created attachment 264604 [details] [review] audio/video: Initialize all {audio|video}info fields
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.
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
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));
Yes please
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