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

UNKNOWN in opj_read_bytes_LE #417

Closed
gcode-importer opened this issue Oct 21, 2014 · 4 comments
Closed

UNKNOWN in opj_read_bytes_LE #417

gcode-importer opened this issue Oct 21, 2014 · 4 comments

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 417

https://code.google.com/p/chromium/issues/detail?id=424331

Reported by detonin on 2014-10-21 12:06:43

@gcode-importer
Copy link
Author

+cc Bo Xu so that you can follow these issues on OpenJPEG side

Reported by detonin on 2014-10-21 15:24:27

@gcode-importer
Copy link
Author

@bo_xu,

the check mentioned in chromium issue has been ported to OpenJpeg in r2897 (trunk),
part of issue 364 you reported. It's not done the same way but done anyway (this can
be seen on image 3.jp2).

With trunk r2908, I have no ASan issues in x86 or x64 on MacOS clang 3.5.0.

What revision of OpenJpeg are you using ?

There's one image that's not decoded by OpenJpeg which probably should (kakadu decodes
it properly).

./bin/opj_decompress -i ../../ex/0.jp2 -o 0.bmp
...
[INFO] Stream reached its end !
[INFO] Generated Outfile 0.bmp

./bin/opj_decompress -i ../../ex/1.jp2 -o 1.bmp
...
[INFO] Stream reached its end !
[INFO] Generated Outfile 1.bmp

./bin/opj_decompress -i ../../ex/2.jp2 -o 2.bmp
...
[INFO] Stream reached its end !
[INFO] Generated Outfile 2.bmp

./bin/opj_decompress -i ../../ex/3.jp2 -o 3.bmp
[INFO] JP2 IHDR box: compression type indicate that the file is not a conforming JP2
file (172) 
[ERROR] Box length is inconsistent.
[ERROR] Stream error while reading JP2 Header box
ERROR -> opj_decompress: failed to read the header

./bin/opj_decompress -i ../../ex/4.jp2 -o 4.bmp
[INFO] Start to read j2k main header (123).
[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.
[ERROR] Stream too short, expected SOT
[ERROR] Failed to decode tile 1/1
[ERROR] Failed to decode the codestream in the JP2 file
ERROR -> opj_decompress: failed to decode image!

kdu_expand -i ../../ex/4.jp2 -o 4.bmp
Consumed 6 tile-part(s) from a total of 1 tile(s).
Consumed 1,834 codestream bytes (excluding any file format) = 1.084886
bits/pel.
Processed using the multi-threaded environment, with
    2 parallel threads of execution

Reported by mayeut on 2014-10-21 18:02:52


- _Attachment: [3.jp2](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-417/comment-2/3.jp2)_ - _Attachment: [4.jp2](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-417/comment-2/4.jp2)_

@gcode-importer
Copy link
Author

Thanks Matthieu !

fixed on chromium side

we keep it open to solve problem with image 4.jp2

Reported by detonin on 2014-10-21 20:40:23

@gcode-importer
Copy link
Author

Closing this security issue & creating a new one for 4.jp2

Fixed by r2897

Reported by mayeut on 2014-10-22 05:54:19

  • Status changed: Fixed

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

No branches or pull requests

2 participants