Skip to content

ioctl: Fix slice range panic when sizing up buffer planes#62

Merged
Gnurou merged 1 commit into
Gnurou:masterfrom
chihchiachen:fix_set_num_planes_size_up
Jun 6, 2026
Merged

ioctl: Fix slice range panic when sizing up buffer planes#62
Gnurou merged 1 commit into
Gnurou:masterfrom
chihchiachen:fix_set_num_planes_size_up

Conversation

@chihchiachen

Copy link
Copy Markdown
Contributor

Calling set_num_planes() on a multi-planar buffer panics when the requested number of planes is greater than the current buffer length (self.buffer.length), because the plane clearing loop constructs an invalid reversed range num_planes..self.buffer.length.

Wrap the plane clearing loop in an if check so that it only runs when sizing down.

Calling set_num_planes() on a multi-planar buffer panics when the requested
number of planes is greater than the current buffer length (self.buffer.length),
because the plane clearing loop constructs an invalid reversed range
num_planes..self.buffer.length.

Wrap the plane clearing loop in an if check so that it only runs when
sizing down.
@Gnurou Gnurou merged commit 4012023 into Gnurou:master Jun 6, 2026
1 check passed
@Gnurou

Gnurou commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Nice catch! Thank you for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants