TIFFReadRGBAStrip() misreads .CR2 file (OJPEG)
Summary
(Summarize the bug encountered concisely) I'm a developer from MathWorks working on image formats. One of our customers reported that his raw image (Roda.CR2 file) wasn't being read correctly ever since we upgraded our software to use the 4.0.10 version of the libtiff library. I verified that the issue is from the library using some repro code that uses the TIFFReadRGBAStrip() function (main.cpp). The same issue isn't there in the previous version.
I also saw that there is some work being done on an issue of a similar nature in the following link: 0356ea76
Could you kindly tell me if this is indeed a known issue and if so what's planned for it?
Version
(libtiff version) 4.0.10
Steps to reproduce
(How one can reproduce the issue - this is very important)
- Find the relevant files in this link.
- Make sure that the main.cpp and Roda.CR2 file are in the same directory.
- Build the main.cpp file with the 4.0.10 version of the libtiff library.
- Run the executable.
- Open the binary file generated by the code in: https://hexed.it/
- You should be able to see a series of 0's followed by 87's (base 16) followed by several 0's again, indicating that the R and B channels are 0's and the G channel is at 135.
Platform
(Operating system, architecture, compiler details)
OS:
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
Kernel:
4.19.0-13-amd64
#1 SMP Debian 4.19.160-2
Compiler:
g++ (Debian 8.3.0-6) 8.3.0
ii g++ 4:8.3.0-1 amd64 GNU C++ compiler
ii g++-8 8.3.0-6 amd64 GNU C++ compiler