mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
jack: protect against bad ports and buffers
This commit is contained in:
parent
11cb77c577
commit
999083105c
1 changed files with 4 additions and 1 deletions
|
|
@ -4087,6 +4087,9 @@ void * jack_port_get_buffer (jack_port_t *port, jack_nframes_t frames)
|
||||||
|
|
||||||
spa_return_val_if_fail(o != NULL, NULL);
|
spa_return_val_if_fail(o != NULL, NULL);
|
||||||
|
|
||||||
|
if (o->type != INTERFACE_Port)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if ((p = o->port.port) == NULL) {
|
if ((p = o->port.port) == NULL) {
|
||||||
struct mix *mix;
|
struct mix *mix;
|
||||||
struct buffer *b;
|
struct buffer *b;
|
||||||
|
|
@ -5711,7 +5714,7 @@ SPA_EXPORT
|
||||||
uint32_t jack_midi_get_event_count(void* port_buffer)
|
uint32_t jack_midi_get_event_count(void* port_buffer)
|
||||||
{
|
{
|
||||||
struct midi_buffer *mb = port_buffer;
|
struct midi_buffer *mb = port_buffer;
|
||||||
if (mb == NULL)
|
if (mb == NULL || mb->magic != MIDI_BUFFER_MAGIC)
|
||||||
return 0;
|
return 0;
|
||||||
return mb->event_count;
|
return mb->event_count;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue