Skip to content

Commit

Permalink
A bit of preemptive defensive code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGriffiths committed Dec 19, 2024
1 parent 814f04e commit 7717e99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/shell/decoration/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ auto msd::Renderer::make_buffer(
return std::nullopt;
}

if (sizeof(Pixel) != MIR_BYTES_PER_PIXEL(buffer_format))
{
log_warning("Failed to draw SSD: tried to create buffer with unsupported format: %d", buffer_format);
return std::nullopt;
}

try
{
return mrs::alloc_buffer_with_content(
Expand Down

0 comments on commit 7717e99

Please sign in to comment.