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

Unable to fuzz with raw image as input #998

Closed
asarubbo opened this issue Aug 18, 2017 · 3 comments
Closed

Unable to fuzz with raw image as input #998

asarubbo opened this issue Aug 18, 2017 · 3 comments

Comments

@asarubbo
Copy link

I have the following problem which is not strictly related to fuzz.

I want to process a RAW file created by openjpeg itself:

# opj_decompress -i file.jp2 -o file.raw                                                                                                                  
                                                                                                                                                                                                                  
[INFO] Start to read j2k main header (85).                                                                                                                                                                        
[INFO] Main header has been correctly decoded.                                                                                                                                                                    
[INFO] No decoded area parameters, set the decoded area to the whole image                                                                                                                                        
[INFO] Header of tile 1 / 1 has been read.                                                                                                                                                                        
[INFO] Stream reached its end !                                                                                                                                                                                   
Raw image characteristics: 3 components                                                                                                                                                                           
Component 0 characteristics: 1x1x8 unsigned                                                                                                                                                                       
Component 1 characteristics: 1x1x8 unsigned                                                                                                                                                                       
Component 2 characteristics: 1x1x8 unsigned                                                                                                                                                                       
[INFO] Generated Outfile file.raw                                                                                                                                                                                 
decode time: 1 ms

It succeeded.

Well, now I want to test the raw file with opj_compress:

# opj_compress -i file.raw -o null.j2k
[ERROR] invalid raw image parameters
Please use the Format option -F:
-F rawWidth,rawHeight,rawComp,rawBitDepth,s/u (Signed/Unsigned)
Example: -i lena.raw -o lena.j2k -F 512,512,3,8,u
Aborting

Let me retry as suggested:

# opj_compress -i file.raw -o null.j2k -F 512,512,3,8,u

Error reading raw file. End of file probably reached.
Unable to load raw file

Any hint?

@rouault
Copy link
Collaborator

rouault commented Aug 18, 2017

Well, the example is just an example ;-) You need to adjust with the values that apply in your case. So here, looking at the output of opj_decompress, that would likely be -F 1,1,3,8,u

@rouault rouault closed this as completed Aug 18, 2017
@asarubbo
Copy link
Author

it still fails in this way here:

[ERROR] Number of resolutions is too high in comparison to the size of tiles
failed to encode image: opj_start_compress
failed to encode image: opj_encode
failed to encode image: opj_end_compress
failed to encode image

@rouault
Copy link
Collaborator

rouault commented Aug 18, 2017

Add -n 1. (side remark: we should probably avoid hardcoding 6 as the default value of -n)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants