diff options
author | Greg Rutz <greg@gsr-tek.com> | 2013-03-11 21:55:28 -0600 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-03-13 00:51:55 +0000 |
commit | c480bac5b7c9628f97d2459bbde534abd219e5c6 (patch) | |
tree | 5c78bcac5cf020988f96b585329ce65656c58c6b | |
parent | 2a1dc7ca5608fecf01061ee3414f3f777e724ae3 (diff) |
libvisual: fix improper video frame clear operation
The current code is memsetting the GstVideoFrame.data address to 0s (which
causes a segfault). This member is actually an array of data buffers (one for
each plane). This fix iterates over each data plane to clear them all.
https://bugzilla.gnome.org/show_bug.cgi?id=695655
-rw-r--r-- | ext/libvisual/gstaudiovisualizer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/libvisual/gstaudiovisualizer.c b/ext/libvisual/gstaudiovisualizer.c index 1ce76d21e..29c45d702 100644 --- a/ext/libvisual/gstaudiovisualizer.c +++ b/ext/libvisual/gstaudiovisualizer.c @@ -1126,7 +1126,11 @@ gst_audio_visualizer_chain (GstPad * pad, GstObject * parent, gst_video_frame_copy (&outframe, &scope->tempframe); } else { /* gst_video_frame_clear() or is output frame already cleared */ - memset (outframe.data, 0, scope->vinfo.size); + gint i; + + for (i = 0; i < scope->vinfo.finfo->n_planes; i++) { + memset (outframe.data[i], 0, outframe.map[i].size); + } } gst_buffer_replace_all_memory (inbuf, |