OLEAUT32: fix detection of GIF palette index >= 128 for transparency

Andreas Mohr andi at rhlx01.fht-esslingen.de
Tue Mar 29 12:41:10 CST 2005


Hi,

On Tue, Mar 29, 2005 at 12:43:38PM -0500, Alex Villaci­s Lasso wrote:
> I traced this problem to a one-line bug in the GIF loading code. The 
> code is supposed to initialize a transparency flag to -1 when no 
> transparency is used, or else the palette index of the transparency 
> color. The sample image I was using indicates that the transparency 
> index is 255. Due to an unintended sign extension, the transparency 
> index (held in a Byte array of basic type "signed char") is 
> sign-extended to the variable "transparency" of basic type "signed int". 
> This causes the flag to be assigned the value -1, which happens to be 
> the same value used as a no-transparency indicator. So transparency was 
                                                     ....^^^^^^^^^^^^    

Heh, 3 times "the transparency" in exactly the same line position, 4 times
"transparency" in exactly the same position - what did you smoke?? ;-)

(or worse, what did *I* smoke to recognize this?? :-)

OK, I promise I'll stop that useless fun email here.

Anyway, thanks for all those nice patches,

Andreas Mohr



More information about the wine-devel mailing list