Skip to content

Commit

Permalink
seq: Fix invalid sanity-check in snd_seq_set_input_buffer_size()
Browse files Browse the repository at this point in the history
snd_seq_set_input_buffer_size() has an assert() call with packet_size,
but it's still uninitialized at that point.  Fix it with the real
packet size.

Fixes: 2aefb5c ("seq: Add UMP support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
tiwai committed Nov 4, 2023
1 parent 96f60d8 commit 915a71a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/seq/seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,9 +1269,9 @@ int snd_seq_set_input_buffer_size(snd_seq_t *seq, size_t size)
size_t packet_size;

assert(seq && seq->ibuf);
packet_size = get_packet_size(seq);
assert(size >= packet_size);
snd_seq_drop_input(seq);
packet_size = get_packet_size(seq);
size = (size + packet_size - 1) / packet_size;
if (size != seq->ibufsize) {
char *newbuf;
Expand Down

0 comments on commit 915a71a

Please sign in to comment.