Summary: | oss-fuzz 5490: Assert triggered in openjpeg | ||
---|---|---|---|
Product: | MuPDF | Reporter: | Sebastian Rasmussen <sebastian.rasmussen> |
Component: | mupdf | Assignee: | MuPDF bugs <mupdf-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | unspecified | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | Minimized PDF from oss-fuzz. |
Description
Sebastian Rasmussen
2018-01-22 06:12:09 UTC
By extracting the j2k stream and attempting to decode this with the openjpeg command line too I can reproduce the crash. By doing the same decoding with the most recent version of openjpeg an error is printed instead. Thus I believe that upgrading openjpeg to a later version will fix this issue. It is not only oss-fuzz 5490 that may be fixed by upgrading openjpeg, in addition 7673, 8129, 8269, 8866, 9379, 9380 and 9734 all seem to be fixable by updating openjpeg. Fixed in commit 2b06a50140b7eb81eb55dcc1547fee4e8842e697 Author: Sebastian Rasmussen <sebras@gmail.com> Date: Fri Sep 14 00:46:28 2018 +0800 Update to OpenJPEG 2.3.0. There is a regression for 2325_-_JPX_image_with_padding_rejected.pdf. Object 3 in that document is a JPX-encoded image. Its EOC marker is preceded by two extra bytes of data, 0x80 0x80. This makes the file broken according to the JPEG 2000 specification. Acrobat Reader and the Kakadu JPX decoder accepts this file without issues, so OpenJPEG 2.1.0 added code to fix this (bug 226, commit 005e75bdc). That fix detects exactly two bytes of 0x80 0x80, a rather brittle fix. Adding more padding or changing the padding byte values is not accepted. Adding more padding is acceptable to Acrobat Reader and Kakadu. An unrelated fix for another problem has since broken OpenJPEG's support for this broken image. |