Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch
Description
Debugging the code I suspected there was something weird, as it would stay a long time in the while look as a += operation had no effect. Then looked up for the extend and section number.
The extend method in the JpegDecoder is using a while instead of an if. If you look at the specification, it is not clear whether it is an if or while, but it looks to me like it is a simple if condition.
Furthermore, if you look at the following examples, it is possible to confirm others implemented the bit extension method with a simple if.
- https://github.com/libjpeg-turbo/libjpeg-turbo/blob/9bc8eb6449a32f452ab3fc9f94af672a0af13f81/jdphuff.c#L204
- https://github.com/lifthrasiir/rust-image/blob/ee0e7064d96a1015650481b7046420e6238cf53d/src/jpeg/decoder.rs#L681
This does not occur in Sanselan as there is JpegDecoder and no extend method as well. Attaching example file that takes over 10 seconds to be processed (up to the point where the decoder throws an exception actually).
Attachments
Attachments
Issue Links
- links to