Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ impl EventBuffer {
)
};

if current_packet_ptr.is_null() {
panic!("MIDIEventListAdd was unable to add the event")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
panic!("MIDIEventListAdd was unable to add the event")
panic!("not enough room in the packet for the event")

}

self.current_packet_offset = unsafe {
(current_packet_ptr as *const u8).offset_from(packet_list_ptr as *const u8) as usize
};
Expand Down
9 changes: 9 additions & 0 deletions src/packets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ impl PacketBuffer {
data.as_ptr(),
)
};

if current_packet_ptr.is_null() {
panic!("MIDIPacketListAdd was unable to add the packet")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
panic!("MIDIPacketListAdd was unable to add the packet")
panic!("not enough room in the packet for the event")

}

let current_packet_offset = unsafe {
(current_packet_ptr as *const u8).offset_from(packet_list_ptr as *const u8) as usize
};
Expand Down Expand Up @@ -281,6 +286,10 @@ impl PacketBuffer {
)
};

if current_packet_ptr.is_null() {
panic!("MIDIPacketListAdd was unable to add the packet")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
panic!("MIDIPacketListAdd was unable to add the packet")
panic!("not enough room in the packet for the event")

}

self.current_packet_offset = unsafe {
(current_packet_ptr as *const u8).offset_from(packet_list_ptr as *const u8) as usize
};
Expand Down
Loading