The image header is a char *, so on platforms with a signed char each
header byte is sign-extended before it's compared against the unsigned
magic. Any magic byte >= 0x80 then fails to match unless IBF_USE_MASK
is set, as the mask happens to strip the sign extension.
Compare the header as uint8_t instead, and add a regression test.