@@ -59,8 +59,8 @@ use core::fmt::{Debug, Formatter};
59
59
use core:: marker:: PhantomData ;
60
60
use core:: ptr:: { self , NonNull } ;
61
61
use uefi_raw:: protocol:: console:: {
62
- GraphicsOutputBltOperation , GraphicsOutputModeInformation , GraphicsOutputProtocol ,
63
- GraphicsOutputProtocolMode ,
62
+ GraphicsOutputBltOperation , GraphicsOutputBltPixel , GraphicsOutputModeInformation ,
63
+ GraphicsOutputProtocol , GraphicsOutputProtocolMode ,
64
64
} ;
65
65
66
66
pub use uefi_raw:: protocol:: console:: PixelBitmask ;
@@ -201,7 +201,8 @@ impl GraphicsOutput {
201
201
match src_region {
202
202
BltRegion :: Full => ( self . 0 . blt ) (
203
203
& 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 ( ) ,
205
206
GraphicsOutputBltOperation :: BLT_BUFFER_TO_VIDEO ,
206
207
0 ,
207
208
0 ,
@@ -217,7 +218,8 @@ impl GraphicsOutput {
217
218
px_stride,
218
219
} => ( self . 0 . blt ) (
219
220
& 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 ( ) ,
221
223
GraphicsOutputBltOperation :: BLT_BUFFER_TO_VIDEO ,
222
224
src_x,
223
225
src_y,
0 commit comments