Fix decoder panic with malformed (empty) sample format tag

I've included a minimal reproducer in
tests/fuzz_images/oor_panic/sample-format-empty-vec.bin
This commit is contained in:
Your Name committed 2025-10-27 15:56:37 +01:00
1 parent 4adba46b9f
commit 714e470595
3 files changed
+8 -10

No files matched your search

+2 -7
View File
@@ -37,8 +37,9 @@ pub type Predictor = crate::tags::Predictor;
#[cfg(feature = "deflate")]
pub type DeflateLevel = compression::DeflateLevel;
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Default)]
pub enum Compression {
#[default]
Uncompressed,
#[cfg(feature = "lzw")]
Lzw,
@@ -47,12 +48,6 @@ pub enum Compression {
Packbits,
}
impl Default for Compression {
fn default() -> Self {
Self::Uncompressed
}
}
impl Compression {
fn tag(&self) -> CompressionMethod {
match self {