@@ -59,8 +59,8 @@ use core::fmt::{Debug, Formatter};
5959use core:: marker:: PhantomData ;
6060use core:: ptr:: { self , NonNull } ;
6161use uefi_raw:: protocol:: console:: {
62- GraphicsOutputBltOperation , GraphicsOutputModeInformation , GraphicsOutputProtocol ,
63- GraphicsOutputProtocolMode ,
62+ GraphicsOutputBltOperation , GraphicsOutputBltPixel , GraphicsOutputModeInformation ,
63+ GraphicsOutputProtocol , GraphicsOutputProtocolMode ,
6464} ;
6565
6666pub use uefi_raw:: protocol:: console:: PixelBitmask ;
@@ -201,7 +201,8 @@ impl GraphicsOutput {
201201 match src_region {
202202 BltRegion :: Full => ( self . 0 . blt ) (
203203 & mut self . 0 ,
204- buffer. as_ptr ( ) as * mut _ ,
204+ // SAFETY: The buffer is only used for reading.
205+ buffer. as_ptr ( ) . cast :: < GraphicsOutputBltPixel > ( ) . cast_mut ( ) ,
205206 GraphicsOutputBltOperation :: BLT_BUFFER_TO_VIDEO ,
206207 0 ,
207208 0 ,
@@ -217,7 +218,8 @@ impl GraphicsOutput {
217218 px_stride,
218219 } => ( self . 0 . blt ) (
219220 & mut self . 0 ,
220- buffer. as_ptr ( ) as * mut _ ,
221+ // SAFETY: The buffer is only used for reading.
222+ buffer. as_ptr ( ) . cast :: < GraphicsOutputBltPixel > ( ) . cast_mut ( ) ,
221223 GraphicsOutputBltOperation :: BLT_BUFFER_TO_VIDEO ,
222224 src_x,
223225 src_y,
0 commit comments