Skip to content

Writing 8 bit signed data on 32 bit Arm fails #1605

@edoenges

Description

@edoenges

Writing jp2 images with 8 bit signed data fails (incorrect data is written) on 32 bit Arm platforms. This is because OPJ_CHAR is defined to be 'char' and assumed to be signed, but on 32 bit Arm, 'char' is unsigned, not signed. This leads to incorrect values being stored in the jp2.

The attached patch fixes the issue by using OPJ_INT8 instead of OPJ_CHAR where it matters. It would also be possible to define OPJ_CHAR to be 'signed char' explicitly, but that could cause problems with string functions.

0001-Use-OPJ_INT8-instead-of-OPJ_CHAR-when-a-signed-type-.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions