audiovisualizer: shaders assume 32bpp

Backport fix for crashes and invalid writes in totem from libvisual
in -base, to minimise differences to version in -base and to make
sure the bug doesn't sneak back in later when the base class is
made public.

The shader code looks like it makes assumptions that are not
necessarily always true, even if they're true for now for the
existing elements, namly that pixel stride is 4, for example.

See https://bugzilla.gnome.org/show_bug.cgi?id=683527
This commit is contained in:
Tim-Philipp Müller 2013-04-05 00:49:46 +01:00
parent bf502f5502
commit a84e2ccbb8

View file

@ -1151,8 +1151,10 @@ gst_audio_visualizer_chain (GstPad * pad, GstObject * parent,
if (!klass->render (scope, inbuf, &outframe)) {
ret = GST_FLOW_ERROR;
} else {
/* run various post processing (shading and geometri transformation */
if (scope->shader) {
/* run various post processing (shading and geometric transformation) */
/* FIXME: SHADER assumes 32bpp */
if (scope->shader &&
GST_VIDEO_INFO_COMP_PSTRIDE (&scope->vinfo, 0) == 4) {
scope->shader (scope, &outframe, &scope->tempframe);
}
}