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

check on PLTE: duplicate & sBIT: out of place #275

Open
ElinorCoding opened this issue Feb 18, 2025 · 0 comments
Open

check on PLTE: duplicate & sBIT: out of place #275

ElinorCoding opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ElinorCoding
Copy link

ElinorCoding commented Feb 18, 2025

check on PLTE: duplicate & sBIT: out of place

version

commit_hash = adc9439

Contact Details

[email protected]

description

Hi,I found that given the following png(maybe not a valid png file), libspng(commit_hash=adc9439) could successfully parse it, while libpng reports errors and warnings: libpng warning: sBIT: out of place, libpng error: PLTE: duplicate.

Meanwhile, I tried an older version of libspng (commit_hash=2a32ffa), and found that the old version does not consider the file as parsable.

I'm not sure if something introduced in a particular commit caused this issue to occur.

reproduction steps

The testcase is attached. You can use the following command to reproduce the issue:

Image

If you need the specific parsing code to reproduce it, it can be easily reproduced from the zip below,because The compilation commands have essentially been scripted.

bugs_report.tar.gz

- prepare the path and sourse

Extract the compressed package bugs_report.tar.gz to a directory, referred to as yourpath2. Modify the file compile_commit_hash.sh and the Makefile to replace yourpath with your actual working directory.

Then, create the directories src/ and build/ in the working directory yourpath . In the src directory, execute the command https://github.com/randy408/libspng to clone the repository.

Finally, modify the file compile_commit_hash.sh to replace yourpath2 with the directory path where you extracted the compressed package.

- compile and test

In the yourpath2 directory, execute the commands:

./compile_commit_hash.sh adc9439

to compile the new versions of spng and to generate the executable files for testing

In the yourpath2 directory, execute the commands:

./compile_commit_hash.sh 2a32ffa

to compile the old versions of spng and to generate the executable files for testing.

In the yourpath2 directory, execute the commands:

./spng_Parse_adc9439 testcase.png

and

./spng_Parse_2a32ffa testcase.png

to observe the different behaviors of libspng on the same testcase.

Expected behavior

The testcase.png : Image should not be parsed successfully in the newest libspng version.

Platform

  • OS: ubuntu22.04.05 (kernel: Linux 6.10.11)
  • Compiler: clang 14.0.0
  • Architecture: x86_64

Additional context

I also test it on libpng , which shows:

libpng warning: sBIT: out of place
libpng error: PLTE: duplicate

and its ret is not 0.

Thanks in advance.
Elinor

@ElinorCoding ElinorCoding added the bug Something isn't working label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant