Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pdf): Perform endian byteswap on correct buffer area for PSD RLE #4600

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

jessey-git
Copy link
Contributor

Description

Perform the endian byteswap on the correct buffer area for PSD RLE decoding. The original code used dst but that pointer is modified from its original value as it progresses through decoding.

Fixes #4599

Tests

It might be prudent to add a test for this. Is the repro file attached to the bug too big for this repo(842kb) or do you want them in the oiio-images repo maybe?

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

…t buffer area for PSD RLE decoding

Signed-off-by: Jesse Yurkovich <[email protected]>
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

Good catch!

@lgritz
Copy link
Collaborator

lgritz commented Jan 18, 2025

Yeah, I would say that anything several hundred KB or more is probably better in the oiio-images repo so that it's only needed if people want to run the testsuite and not if they're just making an untested build.

This is approved as-is as far as I'm concerned. Do you want me to merge now, and we can add the test later, or would you like me to wait while you add the test?

@lgritz lgritz changed the title Fix #4599: Perform endian byteswap on correct buffer area for PSD RLE fix(pdf): Perform endian byteswap on correct buffer area for PSD RLE Jan 18, 2025
@lgritz lgritz added bug Crash or wrong behavior of an existing feature. file formats Image file formats, ImageInput, ImageOutput labels Jan 18, 2025
@jessey-git
Copy link
Contributor Author

I added a PR to the images repo, and if/when that goes in, I'll add a test line for it over here.

Signed-off-by: Jesse Yurkovich <[email protected]>
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

LGTM!

@lgritz lgritz merged commit a50e7c7 into AcademySoftwareFoundation:main Jan 19, 2025
28 checks passed
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Jan 20, 2025
…cademySoftwareFoundation#4600)

Perform the endian byteswap on the correct buffer area for PSD RLE
decoding. The original code used `dst` but that pointer is modified from
its original value as it progresses through decoding.

Fixes AcademySoftwareFoundation#4599 

---------

Signed-off-by: Jesse Yurkovich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Crash or wrong behavior of an existing feature. file formats Image file formats, ImageInput, ImageOutput
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Crash when reading certain PSD files
2 participants