audiovisualizer: shader: Fix dframe out of bound write

shader_fade_and_move_horiz_out writes a complete stride at the end of its
dframe data

This led to SIGSEGV since the stride reached into sframe->map[0]->memory
which could not be umpapped later on.

This is due to `d` is increased twice. Once at the end of the upper loop
and at the start of the lower loop.
The corresponding dframe stride is therefore skipped.

Rewind `d` and start at the correct position.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1702

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1765>
This commit is contained in:
Sebastian Groß 2022-02-20 14:05:05 +01:00 committed by Tim-Philipp Müller
parent 3e02d2af15
commit d6a5711423

View file

@ -336,6 +336,10 @@ shader_fade_and_move_horiz_out (GstAudioVisualizer * scope,
}
d += ds;
}
/* rewind one stride */
d -= ds;
/* move lower half down */
for (j = 0; j < height / 2; j++) {
d += ds;