windows build, apparent bugs


LaszloSebo <laszl...@...>
 

Hi there,

I am a bit of a newbie here, so please be gentle :-)

I built openColorIO yesterday on the windows platform, and while the
process had parts that i had to do manually (for yaml and tinyxml), it
was not extremely hard.

However, i had to mod the source code in a couple of places, which i
think might just be bugs, and not OS specific changes necessarily:

Issue #1: in core/ColorSpaceTransform.cpp:

Line 178: BuildColorSpaceOps function. When converting a lut to an
icc, no default config is used (as far as i understand), so the color
spaces defined are all totally default. Thus, they have no 'allocation
variables', at least nothing initialized for me for that. 2 base color
spaces were made automatically:
RawInput and ProcessedOutput, with basically empty structures (which i
think is fine).

However, around line 203, there is this line:
srcColorSpace->getAllocationVars(&srcAllocation.vars[0])
Since srcAllocation.vars is empty, this will result in an out of
bounds error.

Same thing further down in the function for dstAllocation, around line
235ish.

Issue #2: in core/pystring/pystring.cpp:

Line 254: std::string do_strip() function. The used variables are all
of type std::string::size_type. At least on the windows platform,
thats unsigned int64. That means that it wraps around if you go below
zero, so a crucial test could fail when the string length was zero:

j = len; // so j is initialized with 0

then later:

j--; // now j is, instead of being -1, is equal to the largest
number unsigned int64 can represent

while (j >= i && ::isspace(str[j])) // <-- since j>=i is true,
isspace(str[j]) is tested, and will fail with out of bounds error.
I fixed this by wrapping the whole test in a if len>0 and i=0, j=0
variable initialization.


So with all that said,.. the icc conversion goes through without
errors. However, photoshop cs5 refuses to load them :-\ So i have a
feeling i might still be missing some configuration setting..

Join {ocio-dev@lists.aswf.io to automatically receive all group messages.