mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
audiovisualizer: 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
This commit is contained in:
parent
4eb960d6c3
commit
c66fd54e78
1 changed files with 5 additions and 1 deletions
|
@ -964,7 +964,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,
|
||||
|
|
Loading…
Reference in a new issue