Skip to content

Crash with bitmap images with unsupported bis per pixel #144

Open
@chlorine-dev

Description

@chlorine-dev

I was playing around with bitmap files and creating them by hand, usually timg manages to deal with uncommon / malformed formats very well, by either displaying the image anyways or silently exiting without output, but I encountered a variation where it crashes with
Magick: abort due to signal 6 (SIGABORT) "Abort"...
(Using ImageMagicks's 'display' yields a helpful error message: unsupported bits per pixel)

This happens when asking it to display a bitmap image using BITMAPCOREHEADER that specifies an unsupported bits per pixel, i.e. 3:
minimal_error.zip contains a minimal bitmap file to reproduce the issue,
or alternatively convert the following hexdump into a binary:

00000000  42 4d 36 00 00 00 00 00  00 00 32 00 00 00 0c 00  |BM6.......2.....|
00000010  00 00 08 00 01 00 01 00  03 00 00 00 00 01 01 01  |................|
00000020  02 02 02 03 03 03 04 04  04 05 05 05 06 06 06 07  |................|
00000030  07 07 05 39 77 00                                 |...9w.|

This obviously isn't a huge issue, but it is possible for it to have security implications if it crashes badly instead of gracefully handling it so I thought it was worth bringing up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions