Skip to content

Commit c890d3b

Browse files
author
Andreas Molzer
authored
Merge pull request #1837 from fintelia/issue-1836
Support ICO files with dimensions larger than 256
2 parents 099a4fe + 6a5b618 commit c890d3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/codecs/ico/decoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ impl DirEntry {
231231
}
232232

233233
fn matches_dimensions(&self, width: u32, height: u32) -> bool {
234-
u32::from(self.real_width()) == width && u32::from(self.real_height()) == height
234+
u32::from(self.real_width()) == width.min(256)
235+
&& u32::from(self.real_height()) == height.min(256)
235236
}
236237

237238
fn seek_to_start<R: Read + Seek>(&self, r: &mut R) -> ImageResult<()> {

0 commit comments

Comments
 (0)