Skip to content

Invalid DIB size calculation #3

@ForNeVeR

Description

@ForNeVeR

DeviceIndependentBitmap currently doesn't take into account the color palette stored in the DIB, which makes the size calculation incorrect. Currently it reads:

  • read 40-byte header
  • read (seemingly properly calculated amount of) data bytes into Data

But it should:

  • read 40-byte header
  • read (header.ColorsUsed ?? 1 << header.BitCount) * 4 bytes into Colors
  • read same amount of data into Data

Here's a compressed example of a file that reads incorrectly by the library: _bm0.zip.

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