2017.02.27 23:48 "[Tiff] Possible undefined behaviour in library", by Aaron Boxer

2017.02.28 18:12 "Re: [Tiff] Possible undefined behaviour in library", by Aaron Boxer

False alarm, looks like a bug in my code after all, and possibly in lcms library.

Sorry for the noise,
Aaron

On Mon, Feb 27, 2017 at 6:48 PM, Aaron Boxer <boxerab@gmail.com> wrote:

> Greetings,
>
> I have what I think to be a case of UB in libtiff. Here is my evidence:
>
> I am on Windows, Visual Studio 2015, working with a mono tiff with alpha
> channel and ICC profile:
>
> https://github.com/GrokImageCompression/grok-test-data/blob/
> master/input/nonregression/basn4a08.tif
>
> I execute the following steps:
>
> Step 1: lossless compress to jpeg 2000 using Grok codec
>
> Step 2: decompress back to TIFF using Grok codec
>
> Step 3: compare to original using GraphicsMagick
>
> $ gm compare original.tif round_trip.tif -metric PSNR
>
>
> For step 2, if Grok is running in debug mode, then the round trip image is
> identical
> to the original, as reported by GraphicsMagick.
>
> But, if Grok is running in release mode, then the alpha channels differ.
> PSNR for alpha channel is around 4.8.
>
> Now, you might think this is a bug in Grok. That's what I assumed at
> first.
> But then I decompressed the same jp2 file to TIFF with kdu_expand. And
> that TIFF file also did not match original, AND the PSNR on the alpha
> channel
> was the same as the PSNR from Grok in release mode.
>
> So, what is common between the two binaries? My guess is: libtiff.
>
> So, what is the best way to trouble shoot this problem?
>
> Thanks,
> Aaron
>
>
>
>
>
>
>
>