You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following block of code:
if((index < imgsize)&(index+1 < imgsize))
{
image->comps[0].data[index] = ( dat8[i+0]<<4 ) |(dat8[i+1]>>4);
image->comps[1].data[index] = ((dat8[i+1]& 0x0f)<< 8) | dat8[i+2];
image->comps[2].data[index] = ( dat8[i+3]<<4) |(dat8[i+4]>>4);
image->comps[0].data[index+1] = ((dat8[i+4]& 0x0f)<< 8) | dat8[i+5];
image->comps[1].data[index+1] = ( dat8[i+6] <<4) |(dat8[i+7]>>4);
image->comps[2].data[index+1] = ((dat8[i+7]& 0x0f)<< 8) | dat8[i+8];
index += 2;
}
In first line, it should be logical and, not bitwise and.
In fact, we don't need the line (index < imgSize) at all.
Aaron,
I'll only correct the logical && for now.
The other suggestion seems valid but for overflow checking (we're talking about signed
values so it might not apply given the C standard), I'll let it live like this. It
might be modified with Issue 264 anyway.
Hi Matthieu,
Actually, yes, you're right, you do need both conditions. In case imgSize is odd.
But, if imgSize is odd, we have another bug: the last line will be cut off by this
method. For 12 bit Cinema files.
Not sure how important this is though.
I will open another issue.
Cheers,
Aaron
Originally reported on Google Code with ID 449
Reported by boxerab on 2014-12-10 03:43:27
The text was updated successfully, but these errors were encountered: