mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 15:18:17 +00:00

Mostly added bound checks in case an invalid RLE-compressed bitmap is received. Implementation have been fuzzed for a few hours in order to find blind spots.
20 lines
659 B
Rust
20 lines
659 B
Rust
#![no_main]
|
|
|
|
use bytes::BytesMut;
|
|
use libfuzzer_sys::fuzz_target;
|
|
|
|
#[derive(arbitrary::Arbitrary, Debug)]
|
|
struct Input<'a> {
|
|
src: &'a [u8],
|
|
width: u8,
|
|
height: u8,
|
|
}
|
|
|
|
fuzz_target!(|input: Input<'_>| {
|
|
let mut out = BytesMut::new();
|
|
|
|
let _ = ironrdp_graphics::rle::decompress_24_bpp(input.src, &mut out, input.width, input.height);
|
|
let _ = ironrdp_graphics::rle::decompress_16_bpp(input.src, &mut out, input.width, input.height);
|
|
let _ = ironrdp_graphics::rle::decompress_15_bpp(input.src, &mut out, input.width, input.height);
|
|
let _ = ironrdp_graphics::rle::decompress_8_bpp(input.src, &mut out, input.width, input.height);
|
|
});
|