[LV2] [PATCH 1/5] add eg05-scope example plugin

David Robillard d at drobilla.net
Sun Dec 15 13:00:39 PST 2013


On Mon, 2013-12-09 at 20:41 +0100, Robin Gareus wrote:
[...]
>  plugins/eg05-scope.lv2/examploscope_ui.c   |  629 ++++++++++++++++++++++++++++

There seems to be broken atom logic in this code:

if (/* ... */
    2 == lv2_atom_object_get(obj,
                             ui->uris.channelID, &a0,
                             ui->uris.audioData, &a1,
                             NULL)
    && a0->type == ui->uris.atom_Int
    && a1->type == ui->uris.atom_Vector) {
    /* ... */
    
    LV2_Atom_Vector* vof = (LV2_Atom_Vector*)LV2_ATOM_BODY(a1);

So, a1 is a atom_Vector, but you're casting the *body* of that atom to
LV2_Atom_Vector, which includes an atom header.  I think the subsequent
size calculation and getting of floats is incorrect and bad data is
being passed to the drawing functions.

(Isn't lack of type safety fun?)

-- 
dr





More information about the Devel mailing list