Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
etemesi254 committed Apr 5, 2024
1 parent 285927f commit 37421df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
6 changes: 0 additions & 6 deletions crates/zune-bmp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
//! The decoder is continuously fuzz tested in CI to ensure it does not crash on malicious input
//! in case a sample causes it to crash, an issue would be welcome.

// failing tests
// pal4rlecut.bmp
// pal8rlecut.bmp
// q/rgb24rle24.bmp
//

#![no_std]
#![macro_use]
extern crate alloc;
Expand Down
6 changes: 3 additions & 3 deletions crates/zune-gif/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ pub struct GifDecoder<T: ZByteReaderTrait> {

impl<T: ZByteReaderTrait> GifDecoder<T> {
pub fn new(source: T) -> GifDecoder<T> {
return GifDecoder::new_with_options(source, DecoderOptions::new_fast());
GifDecoder::new_with_options(source, DecoderOptions::new_fast())
}
pub fn new_with_options(source: T, options: DecoderOptions) -> GifDecoder<T> {
return GifDecoder {
GifDecoder {
stream: ZReader::new(source),
options,
width: 0,
Expand All @@ -47,7 +47,7 @@ impl<T: ZByteReaderTrait> GifDecoder<T> {
pal: [[0; 4]; 256],
_dispose_area: Default::default(),
background: vec![]
};
}
}
pub fn decode_headers(&mut self) -> Result<(), GifDecoderErrors> {
if self.read_headers {
Expand Down
6 changes: 2 additions & 4 deletions crates/zune-png/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,7 @@ impl<T: ZByteReaderTrait> PngDecoder<T> {
// zero, and in creating an empty vec nothing is allocated on the heap
// 2 - We convert samples to native endian, so that transmuting is a no-op in case of
// 16 bit images in the next step
// 3 - We use bytemuck to to safe align, hence keeping the no unsafe mantra except
// for platform specific intrinsics


if !self.seen_headers || !self.seen_iend {
self.decode_headers()?;
}
Expand Down Expand Up @@ -1026,7 +1024,7 @@ impl<T: ZByteReaderTrait> PngDecoder<T> {
// raw image bytes
let raw = &in_stride[1..];

// get it's type
// get its type
let mut filter = FilterMethod::from_int(filter_byte)
.ok_or_else(|| PngDecodeErrors::Generic(format!("Unknown filter {filter_byte}")))?;

Expand Down

0 comments on commit 37421df

Please sign in to comment.