AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2018.12.11 13:36 "[Tiff] SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.11 14:29 "Re: [Tiff] SeekOK and WriteOK", by Nicolas RUFF
2018.12.11 18:54 "Re: [Tiff] SeekOK and WriteOK", by Bob Friesenhahn
2018.12.11 14:09 "Re: [Tiff] SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.11 14:01 "Re: [Tiff] SeekOK and WriteOK", by Bob Friesenhahn
2018.12.11 14:24 "Re: [Tiff] SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.12 08:53 "Re: [Tiff] SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.13 11:04 "Re: [Tiff] SeekOK and WriteOK", by Emmanuel Cosnard
2018.12.13 13:13 "Re: [Tiff] SeekOK and WriteOK", by Paavo Helde

2018.12.13 13:13 "Re: [Tiff] SeekOK and WriteOK", by Paavo Helde

On 13.12.2018 13:04, Emmanuel Cosnard wrote:

I found out what the problem was: the buffer size I gave in input of the WriteOK was larger than the actual size of the buffer.

What I don't understand is how libtiff does to not crash, but only sometimes return an error (-1), and sometimes, writing the data of the buffer anyway. Do you have any explanation?

Looks like you are new to the concept of UB. Here is a helpful link: https://raphlinus.github.io/programming/rust/2018/08/17/undefined-behavior.html