Commit a4b59f66 authored by Maks Naumov's avatar Maks Naumov
Browse files

Fix buf nullptr dereferencing in jack_midi_event_write()

parent b5bceb50
......@@ -134,7 +134,7 @@ int jack_midi_event_write(void* port_buffer,
jack_nframes_t time, const jack_midi_data_t* data, size_t data_size)
{
JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer;
if (!buf && !buf->IsValid()) {
if (!buf || !buf->IsValid()) {
return -EINVAL;
}
if (time >= buf->nframes || (buf->event_count && buf->events[buf->event_count - 1].time > time)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment