summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2013-12-20 08:41:45 -0500
committerEdward Hervey <bilboed@bilboed.com>2013-12-20 14:47:22 +0100
commitb97c711defc9f8f7bb77f7cc4dfb4d85fb33b7f8 (patch)
tree88defab47a5c3927026bfefcea71630d8a512302
parent86b0a0d6d0a277f5e55e06ea6bb2bf9397fb4e9a (diff)
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
-rw-r--r--gst-libs/gst/audio/audio-info.c1
-rw-r--r--gst-libs/gst/video/video-info.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/audio-info.c b/gst-libs/gst/audio/audio-info.c
index 2cae7e124..53cdd5b59 100644
--- a/gst-libs/gst/audio/audio-info.c
+++ b/gst-libs/gst/audio/audio-info.c
@@ -131,6 +131,7 @@ gst_audio_info_set_format (GstAudioInfo * info, GstAudioFormat format,
info->bpf = (finfo->width * channels) / 8;
memset (&info->position, 0xff, sizeof (info->position));
+ memset (&info->_gst_reserved, 0xff, sizeof (info->_gst_reserved));
if (!position && channels == 1) {
info->position[0] = GST_AUDIO_CHANNEL_POSITION_MONO;
diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c
index 6db2f664b..814022839 100644
--- a/gst-libs/gst/video/video-info.c
+++ b/gst-libs/gst/video/video-info.c
@@ -110,6 +110,7 @@ gst_video_info_set_format (GstVideoInfo * info, GstVideoFormat format,
}
fill_planes (info);
+ memset (&info->_gst_reserved, 0xff, sizeof (info->_gst_reserved));
}
static const gchar *interlace_mode[] = {