Skip to content

fix(bmp): detect corrupt files where palette doesn't match bpp - #5030

Merged
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-bmpcrash
Feb 7, 2026
Merged

fix(bmp): detect corrupt files where palette doesn't match bpp#5030
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-bmpcrash

Conversation

@lgritz

@lgritz lgritz commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

Extra protections for corrupted BMP files that claim to be palette images, but have a BPP that doesn't support palette images. Also an extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also
an extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>

@jessey-git jessey-git left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that this does fix the issue here.

@lgritz
lgritz merged commit ee3370d into AcademySoftwareFoundation:main Feb 7, 2026
30 checks passed
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Feb 7, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Feb 7, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz
lgritz deleted the lg-bmpcrash branch February 7, 2026 19:59
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Feb 24, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 2, 2026
…mySoftwareFoundation#5030)

Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.

Add an extra test case for this kind of corruption.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants