Hello, Oliver, I was trying to understand if the proposed change would be sensible. I wonder why we are calling GetDIBits [1] at lines 119-120 twice. Could it be a cut & paste error?
Thanks. [1] http://msdn.microsoft.com/en-us/library/ms532334.aspx On Thu, Sep 11, 2008 at 6:29 PM, Oliver Deakin <[EMAIL PROTECTED]> wrote: > Hi all, > > Im just going through the last of the errors in HARMONY-5976 and there is a > bug in WinGraphicsEnvironment.cpp in the > Java_org_apache_harmony_awt_gl_windows_WinGraphicsConfiguration_createColorModel() > function. > > We create the variable "mask" on line 111. If the if-statement on line 126 > evaluates false, we enter the else block where mask is still not > initialised. In the cases where the number of bits is 16 or 32, we set > pfType to be PF_16RGB55 or PF_32RGB888. When we then enter the switch block > on line 175, we try to then use the uninitialised mask variable in calls to > NewObject(), which is clearly wrong. > > It seems a fix for this would be to move the line initialising mask > (currently line 127) to before the if-statement it is currently inside. I > wanted to check if anyone has any opinions/objections on this? If there are > no objections, I will commit the change. > > Regards, > Oliver > > -- > Oliver Deakin > Unless stated otherwise above: > IBM United Kingdom Limited - Registered in England and Wales with number > 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire > PO6 3AU > > -- With best regards, Alexei
