Skip to content

Commit

Permalink
Merge pull request #545 from Enet4/bug/parser/read_pixel_representati…
Browse files Browse the repository at this point in the history
…on_panic

Check presence of value byte in Pixel Representation value
  • Loading branch information
Enet4 authored Jul 25, 2024
2 parents cf484db + 0904c86 commit 4876a59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/src/stateful/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ where

if header.tag == Tag(0x0028, 0x0103) {
//Pixel Representation is not 0, so 2s complement (signed)
self.signed_pixeldata = Some(vec[0] != 0);
self.signed_pixeldata = vec.first().map(|rep| *rep != 0);
}

Ok(PrimitiveValue::U16(vec))
Expand Down

0 comments on commit 4876a59

Please sign in to comment.