OpenEXR crash

Alexandre Thibodeau <[email protected]>
Newsgroups gmane.comp.video.openexr.devel
Message-ID <CABRp2zR5EoY6e7M6En_Og6jQ_EUSuzT-618hJQW6=zJyFowB0A@mail.gmail.com>
Hi,

I'm am developing a tool using OpenEXR. I use the MultiPartOutputFile API
because I will eventually support multi-part files. As an initial test, I
tried writing a single part file with the multi-part API. I didn't want to
implement two different interfaces, so I didn't use the single-part API.

In the function GenericOutputFile::writeMagicNumberAndVersionField, called
by the constructor of MultiPartOutputFile, a special check is made for
(parts == 1). If it's the case (it was for me), headers[0].type() is
called. Unlike the other types of files, MultiPartOutputFile does not set
the file type to SCANLINEIMAGE. As a result, the attribute is not set, and
causes a crash.

A workaround consists of manually calling SetType(SCANLINEIMAGE) after
creating the header. However, to avoid that someone get into the same
issue, I suggest that MultiPartOutputFile should be set to SCANLINEIMAGE by
default, like it's the case for the other API.

Thanks

_______________________________________________
Openexr-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/openexr-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.