Klaudit / gdipp

Automatically exported from code.google.com/p/gdipp
0 stars 2 forks source link

Bug in GetTextExtentExPointW makes Spotify crash #171

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

Spotify crashes inside GetTextExtentExPointW in gdipp. Go to the start page in 
Spotify and hover over the texts.

The problem is that *lpnFit is not always set to a valid value even though the 
function returns TRUE. It happens when nMaxExtent is a low value such as 1.

Here's the relevant source code from gdipp:

        if (lpnFit != NULL || lpnDx != NULL)
        {
                list<RECT>::const_iterator box_iter;
                INT curr_index;
                for (box_iter = a_glyph_run.ctrl_boxes.begin(), curr_index = 0; box_iter != a_glyph_run.ctrl_boxes.end(); box_iter++, curr_index++)
                {
                        if (lpnFit != NULL && box_iter->right <= nMaxExtent)
                                *lpnFit = curr_index + 1;

                        if (lpnDx != NULL)
                                lpnDx[curr_index] = box_iter->right - a_glyph_run.ctrl_boxes.front().left;
                }
        }

        return true;

Original issue reported on code.google.com by strig...@gmail.com on 6 May 2011 at 9:47

GoogleCodeExporter commented 9 years ago
My Spotify also crash with gdipp but the workaround is to exlude it in 
gdipp_setting.xml until they release a new version of gdipp. (That hopefully 
resolves the issue)

Original comment by end...@gmail.com on 22 May 2011 at 5:07